-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from JadenFiotto-Kaufman/nopickle
Nopickle
- Loading branch information
Showing
9 changed files
with
349 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .functions import FUNCTIONS_WHITELIST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import operator | ||
from inspect import getmembers, isbuiltin, ismethoddescriptor | ||
|
||
import torch | ||
|
||
from ... import util | ||
from ...tracing.Proxy import Proxy | ||
|
||
FUNCTIONS_WHITELIST = {} | ||
FUNCTIONS_WHITELIST.update( | ||
{ | ||
f"_VariableFunctionsClass.{key}": value | ||
for key, value in getmembers(torch._C._VariableFunctions, isbuiltin) | ||
} | ||
) | ||
FUNCTIONS_WHITELIST.update( | ||
{ | ||
f"Tensor.{key}": value | ||
for key, value in getmembers(torch._C._TensorBase, ismethoddescriptor) | ||
} | ||
) | ||
FUNCTIONS_WHITELIST.update( | ||
{ | ||
f"{key}": value | ||
for key, value in getmembers(operator, isbuiltin) | ||
if not key.startswith("_") | ||
} | ||
) | ||
FUNCTIONS_WHITELIST.update( | ||
{ | ||
"null": "null", | ||
"module": "module", | ||
"argument": "argument", | ||
"swp": "swp", | ||
"fetch_attr": util.fetch_attr, | ||
"Proxy.proxy_call": Proxy.proxy_call, | ||
} | ||
) |
Oops, something went wrong.