producer_version: "0.4"
graph {
node {
- input: "0"
+ input: "self"
output: "1"
op_type: "ReduceL2"
attribute {
}
name: "torch-jit-export"
input {
- name: "0"
+ name: "self"
type {
tensor_type {
elem_type: 1
// they are keywords or namespaces used in the output
const static std::unordered_set<std::string> reserved_names = {
// identifiers in the environment while parsing
- "_", // avoid the confusing unnamed _
"aten",
- "attribute",
+ "ops",
"CONSTANTS",
"fork",
+ "attribute",
"getattr",
+ "_", // avoid the confusing unnamed _
"inf",
"nan",
- "ops",
- "self",
// the python keywords
+ "False",
+ "None",
+ "True",
"and",
"as",
"assert",
- "async",
- "await",
"break",
"class",
"continue",
"elif",
"else",
"except",
- "False",
"finally",
"for",
"from",
"in",
"is",
"lambda",
- "None",
"nonlocal",
"not",
"or",
"pass",
"raise",
"return",
- "True",
"try",
"while",
"with",
for k, v in f_locals.items():
if isinstance(v, torch.Tensor) and var is v:
- return k if k != 'self' else ''
+ return k
for k, v in f_globals.items():
if isinstance(v, torch.Tensor) and var is v:
- return k if k != 'self' else ''
+ return k
return ''
return _get_interpreter_name_for_var