Files
pytorch/tools/build_defs/buck_helpers.bzl
Linbin Yu c9cbdb411d [2] move more pytorch buck targets to shared build (#79330)
Summary: as title

Test Plan: sandcastle and oss CI

Differential Revision: D37087229

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79330
Approved by: https://github.com/dhruvbird
2022-06-22 03:14:23 +00:00

28 lines
563 B
Python

# Only used for PyTorch open source BUCK build
IGNORED_ATTRIBUTE_PREFIX = [
"apple",
"fbobjc",
"windows",
"fbandroid",
"macosx",
]
IGNORED_ATTRIBUTES = [
"feature",
"platforms",
]
def filter_attributes(kwgs):
keys = list(kwgs.keys())
# drop unncessary attributes
for key in keys:
if key in IGNORED_ATTRIBUTES:
kwgs.pop(key)
else:
for invalid_prefix in IGNORED_ATTRIBUTE_PREFIX:
if key.startswith(invalid_prefix):
kwgs.pop(key)
return kwgs