# Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain fbcode-only targets. load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") oncall("executorch") runtime.python_library( name = "backend", srcs = glob([ "compiler/*.py", ]), visibility = [ "@EXECUTORCH_CLIENTS", ], deps = [ ":executorchcoreml", "//executorch/exir/backend:backend_details", "//executorch/exir/backend:compile_spec_schema", "fbsource//third-party/pypi/coremltools:coremltools", ], ) runtime.python_library( name = "partitioner", srcs = glob([ "partition/*.py", ]), visibility = [ "@EXECUTORCH_CLIENTS", ], deps = [ ":backend", "//caffe2:torch", "//executorch/exir:lib", "//executorch/exir/backend:compile_spec_schema", "//executorch/exir/backend:partitioner", "//executorch/exir/backend:utils", "fbsource//third-party/pypi/coremltools:coremltools", ], ) runtime.python_library( name = "quantizer", srcs = glob([ "quantizer/*.py", ]), visibility = [ "@EXECUTORCH_CLIENTS", ], ) runtime.cxx_python_extension( name = "executorchcoreml", srcs = [ "runtime/inmemoryfs/inmemory_filesystem.cpp", "runtime/inmemoryfs/inmemory_filesystem_py.cpp", "runtime/inmemoryfs/inmemory_filesystem_utils.cpp", "runtime/inmemoryfs/memory_buffer.cpp", "runtime/inmemoryfs/memory_stream.cpp", "runtime/inmemoryfs/reversed_memory_stream.cpp", "runtime/util/json_util.cpp", ], headers = glob([ "runtime/inmemoryfs/**/*.hpp", ]), preprocessor_flags = [ "-Iexecutorch/backends/apple/coreml/runtime/util", ], types = [ "executorchcoreml.pyi", ], compiler_flags = [ "-std=c++17", ], base_module = "", visibility = [ "//executorch/examples/apple/coreml/...", ], external_deps = [ "pybind11", ], deps = [ "fbsource//third-party/nlohmann-json:nlohmann-json", ], ) runtime.python_test( name = "test", srcs = glob([ "test/*.py", ]), deps = [ ":partitioner", ":quantizer", "//caffe2:torch", "//pytorch/vision:torchvision", "fbsource//third-party/pypi/pytest:pytest", ], )