/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/ir
NameSizeModeActions
alias_analysis.h117640644editdlrm
attributes.h49970644editdlrm
constants.h20460644editdlrm
graph_node_list.h63600644editdlrm
ir.h491560644editdlrm
irparser.h7670644editdlrm
ir_views.h46340644editdlrm
named_value.h24570644editdlrm
node_hashing.h2900644editdlrm
scope.h68250644editdlrm
subgraph_matcher.h31510644editdlrm
type_hashing.h4490644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/ir/constants.h (2046B)
#pragma once #include #include #include #include #include // helpers for handling constants in the IR // - create constant nodes from ints, floats, complex, intlist, Tensors, and // other types // - implement primitive constant ops. namespace torch { namespace jit { using ::c10::IValue; struct Graph; struct Value; // thrown when insertConstant cannot encode the IValue into a graph struct TORCH_API constant_not_supported_error : public std::runtime_error { using runtime_error::runtime_error; }; TORCH_API Value* insertConstant( Graph& g, const IValue& val, c10::optional loc = c10::nullopt, c10::optional scope = c10::nullopt); // note: prefer g.insertConsant(val, loc) which does exactly the same thing // this function is only declared/defined here because its implementation is // closely related to the implementation of prim::Constant that is also in // constants.cpp. // // returns a c10::nullopt if the IValue kind cannot be inserted as a constant TORCH_API c10::optional tryInsertConstant( Graph& g, const IValue& val, c10::optional loc = c10::nullopt, c10::optional scope = c10::nullopt); //////////////////////////////////////////////////////////////////////////////// // Helper for retrieving constants //////////////////////////////////////////////////////////////////////////////// // attempt to convert a (possibly constant) Value* into an interpreter value // (IValue). returns c10::nullopt if the Value* was not constant TORCH_API c10::optional toIValue(const Value* v); // if a value is a constant then try to turn into type T using the // same rules as the interpreter template c10::optional constant_as(const Value* v) { if (auto ivalue = toIValue(v)) { return ivalue->to(); } return c10::nullopt; } } // namespace jit } // namespace torch