/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/mini_environment.h (1366B)
#pragma once #include #include namespace torch { namespace jit { // Simple data structure for containing a type T in nested control blocks // Should only be used after initial compilation where type checking and // loads and stores are emitted template struct MiniEnvironment { MiniEnvironment(Block* b, std::shared_ptr next = nullptr) : next(std::move(next)) {} // NOLINTNEXTLINE(cppcoreguidelines-non-private-member-variables-in-classes) std::shared_ptr> next; T findInThisFrame(const std::string& name) { auto it = table.find(name); if (it != table.end()) { return it->second; } return nullptr; } T findInAnyFrame(const std::string& name) { for (auto runner = this; runner; runner = runner->next.get()) { if (auto r = runner->findInThisFrame(name)) { return r; } } return nullptr; } void setVar(const std::string& name, T value) { table[name] = value; } std::vector definedVariables() { std::vector result; for (auto& kv : table) { result.push_back(kv.first); } std::sort(result.begin(), result.end()); return result; } private: std::unordered_map table; }; } // namespace jit } // namespace torch