mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
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
28 lines
563 B
Python
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
|