# 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")
load(":targets.bzl", "define_common_targets")

oncall("executorch")

define_common_targets()

runtime.cxx_python_extension(
    name = "_training_lib",
    srcs = [
        "_training_lib.cpp",
    ],
    base_module = "executorch.extension.training.pybindings",
    types = ["_training_lib.pyi"],
    visibility = ["//executorch/extension/training/..."],
    deps = [
        "fbsource//third-party/pybind11:pybind11",
        "//executorch/extension/aten_util:aten_bridge",
        "//executorch/extension/training/optimizer:sgd",
    ],
    external_deps = ["libtorch_python"],
)

runtime.python_library(
    name = "_training_module",
    srcs = [
        "_training_module.py",
    ],
    base_module = "executorch.extension.training.pybindings",
    visibility = ["//executorch/extension/training/..."],
    deps = [
        "//caffe2:torch",
        "//executorch/extension/pybindings:portable_lib",
    ],
)
