Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ab92bf7
use the //tools/codegen target in Bazel
Mar 21, 2022
6d47237
Update on "use the //tools/codegen target in Bazel"
Mar 21, 2022
230ab49
Update on "use the //tools/codegen target in Bazel"
Mar 21, 2022
72fb446
Update on "use the //tools/codegen target in Bazel"
Mar 21, 2022
fbbc516
Update on "use the //tools/codegen target in Bazel"
Mar 21, 2022
b58ba9d
Update on "use the //tools/codegen target in Bazel"
Mar 21, 2022
6724fd4
Update on "use the //tools/codegen target in Bazel"
Mar 22, 2022
5b93b02
Update on "use the //tools/codegen target in Bazel"
Mar 22, 2022
740aa0b
Update on "use the //tools/codegen target in Bazel"
Mar 22, 2022
8ba7663
Update on "use the //tools/codegen target in Bazel"
Mar 22, 2022
21adccf
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
5778a84
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
620384f
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
e1dd6a0
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
09cda98
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
c80e372
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
1d253de
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
7aed87e
Update on "use the //tools/codegen target in Bazel"
Mar 24, 2022
2b26f8e
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
58e993a
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
e41aa7c
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
9b1d3b0
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
a215359
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
b34d27a
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
0f4d938
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
b099744
Update on "use the //tools/codegen target in Bazel"
Mar 25, 2022
90f5ea0
Update on "use the //tools/codegen target in Bazel"
Mar 28, 2022
f531c56
Update on "use the //tools/codegen target in Bazel"
Mar 28, 2022
9dd73e4
Update on "use the //tools/codegen target in Bazel"
Mar 28, 2022
5054db9
Update on "use the //tools/codegen target in Bazel"
Mar 28, 2022
23194ec
Update on "use the //tools/codegen target in Bazel"
Mar 28, 2022
c4c8ae5
Update on "use the //tools/codegen target in Bazel"
Mar 29, 2022
c91f365
Update on "use the //tools/codegen target in Bazel"
Mar 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ py_binary(
name = "gen",
srcs = ["tools/setup_helpers/gen.py"],
deps = [
":tools_codegen"
"//tools/codegen"
],
)

Expand Down Expand Up @@ -105,19 +105,14 @@ generate_aten(
generator=":gen",
)

py_library(
name = "tools_codegen",
srcs = glob(["tools/codegen/**/*.py"]),
)

py_library(
name = "tools_autograd",
srcs = glob(["tools/autograd/*.py"]),
data = glob([
"tools/autograd/*.yaml",
"tools/autograd/templates/*",
]),
deps = [":tools_codegen"],
deps = ["//tools/codegen"],
)

py_library(
Expand Down Expand Up @@ -1380,7 +1375,7 @@ cc_library(
py_binary(
name = "gen_op",
srcs = ["caffe2/contrib/aten/gen_op.py"],
deps = [":tools_codegen"],
deps = ["//tools/codegen"],
)

genrule(
Expand Down
9 changes: 9 additions & 0 deletions tools/bazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ load("@rules_cuda//cuda:defs.bzl", "requires_cuda_enabled")
load("//c10/macros:cmake_configure_file.bzl", "cmake_configure_file")
load("//tools/config:defs.bzl", "if_cuda")

def _py_library(name, **kwds):
deps = [dep for dep in kwds.pop("deps", []) if dep != None]
native.py_library(name = name, deps = deps, **kwds)

def _requirement(_pypi_project):
return None

# Rules implementation for the Bazel build system. Since the common
# build structure aims to replicate Bazel as much as possible, most of
# the rules simply forward to the Bazel definitions.
Expand All @@ -14,6 +21,8 @@ rules = struct(
filegroup = native.filegroup,
glob = native.glob,
if_cuda = if_cuda,
py_library = _py_library,
requirement = _requirement,
requires_cuda_enabled = requires_cuda_enabled,
select = select,
test_suite = native.test_suite,
Expand Down
4 changes: 4 additions & 0 deletions tools/codegen/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
load("//:tools/bazel.bzl", "rules")
load(":build.bzl", "define_targets")

define_targets(rules = rules)