/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/frontend
NameSizeModeActions
builtin_functions.h2540644editdlrm
canonicalize_modified_loop.h3260644editdlrm
code_template.h70570644editdlrm
concrete_module_type.h90400644editdlrm
convert_to_ssa.h3410644editdlrm
edit_distance.h2680644editdlrm
error_report.h14800644editdlrm
exit_transforms.h2320644editdlrm
function_schema_parser.h4600644editdlrm
inline_loop_condition.h3660644editdlrm
ir_emitter.h5410644editdlrm
lexer.h184700644editdlrm
mini_environment.h13660644editdlrm
name_mangler.h6690644editdlrm
parser.h6880644editdlrm
parser_constants.h1620644editdlrm
parse_string_literal.h22950644editdlrm
resolver.h19720644editdlrm
schema_matching.h19480644editdlrm
schema_type_parser.h9770644editdlrm
script_type_parser.h16190644editdlrm
source_range.h60380644editdlrm
source_ref.h12690644editdlrm
strtod.h2400644editdlrm
sugared_value.h268050644editdlrm
tracer.h119250644editdlrm
tree.h66350644editdlrm
tree_views.h356960644editdlrm
versioned_symbols.h5970644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/frontend/resolver.h (1972B)
#pragma once #include #include #include namespace torch { namespace jit { struct Resolver; using ResolverPtr = std::shared_ptr; /** * class Resolver * * Represents an "outer environment" in which we an look up names and return * a corresponding SugaredValue. This is used during compilation to resolve * references to names which are not defined internal to the graph. * * Example: PythonResolver looks at the enclosing Python scope for `name`. * * NOTE: When adding methods, keep this an abstract class (i.e. all new methods * should be purely virtual). Resist the urge to provide a default * implementation; you should explicitly think about how each resolver would * handle the method. */ struct Resolver { virtual ~Resolver() = default; // Resolve a given name to a SugaredValue. This takes the method `m` that the // caller is currently constructing, since we may need to insert nodes into // the graph to create a value. virtual std::shared_ptr resolveValue( const std::string& name, Function& m, const SourceRange& loc) { return nullptr; } // Resolve `name` to a TypePtr. virtual TypePtr resolveType(const std::string& name, const SourceRange& loc) { return nullptr; } }; // A resolver that only understands "torch.foo()" lookups. struct NativeResolver : public Resolver { std::shared_ptr resolveValue( const std::string& name, Function& m, const SourceRange& loc) override { if (name == "torch") { return std::make_shared("aten"); } return nullptr; } TypePtr resolveType(const std::string& name, const SourceRange& loc) override { return nullptr; } }; inline std::shared_ptr nativeResolver() { return std::make_shared(); } } // namespace jit } // namespace torch