mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
[codemod][fbcode][1/n] Apply buildifier
Test Plan: Manual inspection. Sandcastle. Reviewed By: karlodwyer, zsol Differential Revision: D27702434 fbshipit-source-id: ee7498331c51daf44a29f2de452e3b02488b9af3
This commit is contained in:
parent
db394efbb9
commit
684589e8e0
3 changed files with 18 additions and 17 deletions
3
aten.bzl
3
aten.bzl
|
|
@ -16,7 +16,8 @@ def intern_build_aten_ops(copts, deps):
|
|||
[
|
||||
PREFIX + "cpu/*.cpp",
|
||||
PREFIX + "quantized/cpu/kernels/*.cpp",
|
||||
]):
|
||||
],
|
||||
):
|
||||
name = impl.replace(PREFIX, "")
|
||||
out = PREFIX + name + "." + cpu_capability + ".cpp"
|
||||
native.genrule(
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
# gpu support is not available
|
||||
def cu_library(**kwargs):
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
def _impl(repository_ctx):
|
||||
archive = repository_ctx.attr.name + ".tar"
|
||||
reference = Label("@%s_unpatched//:README" % repository_ctx.attr.name)
|
||||
dirname = repository_ctx.path(reference).dirname
|
||||
repository_ctx.execute(["tar", "hcf", archive, "-C", dirname, "."])
|
||||
repository_ctx.extract(archive)
|
||||
for patch in repository_ctx.attr.patches:
|
||||
repository_ctx.patch(repository_ctx.path(patch), repository_ctx.attr.patch_strip)
|
||||
build_file = repository_ctx.path(repository_ctx.attr.build_file)
|
||||
repository_ctx.execute(["cp", build_file, "BUILD.bazel"])
|
||||
archive = repository_ctx.attr.name + ".tar"
|
||||
reference = Label("@%s_unpatched//:README" % repository_ctx.attr.name)
|
||||
dirname = repository_ctx.path(reference).dirname
|
||||
repository_ctx.execute(["tar", "hcf", archive, "-C", dirname, "."])
|
||||
repository_ctx.extract(archive)
|
||||
for patch in repository_ctx.attr.patches:
|
||||
repository_ctx.patch(repository_ctx.path(patch), repository_ctx.attr.patch_strip)
|
||||
build_file = repository_ctx.path(repository_ctx.attr.build_file)
|
||||
repository_ctx.execute(["cp", build_file, "BUILD.bazel"])
|
||||
|
||||
_patched_rule = repository_rule(
|
||||
implementation = _impl,
|
||||
|
|
@ -19,11 +19,11 @@ _patched_rule = repository_rule(
|
|||
)
|
||||
|
||||
def new_patched_local_repository(name, path, **kwargs):
|
||||
native.new_local_repository(
|
||||
name = name + "_unpatched",
|
||||
build_file_content = """
|
||||
native.new_local_repository(
|
||||
name = name + "_unpatched",
|
||||
build_file_content = """
|
||||
pkg_tar(name = "content", srcs = glob(["**"]))
|
||||
""",
|
||||
path = path,
|
||||
)
|
||||
_patched_rule(name = name, **kwargs)
|
||||
path = path,
|
||||
)
|
||||
_patched_rule(name = name, **kwargs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue