|
TORCH_API void | preoptimizeGraph (std::shared_ptr< Graph > &graph) |
|
static IValue & | peek (Stack &stack, size_t i, size_t N) |
|
static IValue & | peek (Stack *stack, size_t i, size_t N) |
|
static const IValue & | peek (const Stack &stack, size_t i, size_t N) |
|
static const IValue & | peek (const Stack *stack, size_t i, size_t N) |
|
static at::ArrayRef< IValue > | peekSlice (const Stack &stack, size_t i, size_t len, size_t N) |
|
static at::ArrayRef< IValue > | last (const Stack &stack, size_t N) |
|
static at::ArrayRef< IValue > | last (const Stack *stack, size_t N) |
|
static void | drop (Stack &stack, size_t n) |
|
static void | drop (Stack *stack, size_t n) |
|
static IValue | pop (Stack &stack) |
|
static IValue | pop (Stack *stack) |
|
static std::vector< IValue > | pop (Stack &stack, size_t n) |
|
template<typename... Types> |
static void | pop (Stack &stack, Types &... args) |
|
template<typename... Types> |
static void | pop (Stack *stack, Types &... args) |
|
template<typename Type > |
static void | push_one (Stack &stack, Type &&arg) |
|
static void | push_one (Stack &stack, c10::TensorOptions options) |
|
template<typename... Types> |
static void | push (Stack &stack, Types &&... args) |
|
template<typename... Types> |
static void | push (Stack *stack, Types &&... args) |
|
template<class T > |
static void | push_list_elements (Stack &stack, const c10::List< T > &elements) |
|
template<typename T > |
void | pack (Stack &stack, T &&v) |
|
template<typename T > |
void | pack (Stack *stack, T &&v) |
|
template<typename... Args> |
void | pack (Stack &stack, std::tuple< Args... > &&t) |
|
void | dump_opnames (const Module &m, std::unordered_set< std::string > &opnames) |
|
TORCH_API std::shared_ptr< CompilationUnit > | compile (const std::string &source) |
| Compiles script code into an executable graph. More...
|
|
void | placeholderCreator (GraphFunction &) |
|
static ObjectPtr | create_module_object (c10::QualifiedName class_name, std::shared_ptr< CompilationUnit > cu, bool shouldMangle=false) |
|
bool & | getInlineEverythingMode () |
|
void | module_state_to (const autograd::Variable &variable, const c10::optional< at::Device > &device, const c10::optional< at::ScalarType > &dtype, bool non_blocking) |
|
Module | freeze (const Module &module, c10::optional< std::vector< std::string > > preserved_attrs, bool optimize_numerics) |
|
std::unordered_set< TypePtr > | getSharedModuleTypes (Module &mod) |
|
void | toBackendSelectiveImpl (Module &mod, const py::function &to_backend, const std::vector< std::string > &modules_to_lower, const std::unordered_set< TypePtr > &duplicate_types) |
|
void | initJitBackendBindings (PyObject *module) |
|
std::shared_ptr< Resolver > | loweredModuleResolver () |
|
int64_t | registerFusion (const Node *fusion_group) |
|
void | runFusion (const int64_t key, Stack &stack) |
|
bool | canFuseOnCPU () |
|
bool | canFuseOnGPU () |
|
void | overrideCanFuseOnCPU (bool value) |
|
void | overrideCanFuseOnGPU (bool value) |
|
std::vector< at::Tensor > | debugLaunchGraph (Graph &graph, at::ArrayRef< at::Tensor > inputs) |
|
std::string | debugGetFusedKernelCode (Graph &graph, at::ArrayRef< at::Tensor > inputs) |
|
size_t | nCompiledKernels () |
|
TORCH_API void | overrideMustUseLLVMOnCPU (bool value) |
|
| TORCH_LIBRARY (cuda, m) |
|
const std::vector< Function * > & | getAllBuiltinFunctionsFor (Symbol name) |
|
void | canonicalizeModifiedLoop (Node *n) |
|
void | canonicalizeModifiedLoops (Block *block) |
|
TORCH_API void | CanonicalizeModifiedLoops (std::shared_ptr< Graph > &graph) |
|
static std::string | format (const std::string &fmt, TemplateEnv &env) |
|
bool | operator== (const ConcreteModuleTypeBuilder::ModuleInfo &lhs, const ConcreteModuleTypeBuilder::ModuleInfo &rhs) |
|
void | ConvertToSSA (std::shared_ptr< Graph > &graph) |
|
size_t | ComputeEditDistance (const char *word1, const char *word2, size_t maxEditDistance) |
|
std::string | get_stacked_errors (const std::vector< Call > &error_stack) |
|
template<typename T > |
const ErrorReport & | operator<< (const ErrorReport &e, const T &t) |
|
bool | inlineConsecutiveIfs (Node *node) |
|
void | inlineConsecutiveIfs (Block *block) |
|
static void | convertEnterExitNodesToWithBlocks (std::shared_ptr< Graph > &graph) |
|
static void | convertWithBlocksToEnterExitNodes (std::shared_ptr< Graph > &graph) |
|
void | TransformExits (std::shared_ptr< Graph > &graph) |
|
C10_EXPORT either< OperatorName, FunctionSchema > | parseSchemaOrName (const std::string &schemaOrName) |
|
C10_EXPORT FunctionSchema | parseSchema (const std::string &schema) |
|
C10_EXPORT OperatorName | parseName (const std::string &name) |
|
void | InlineBlockBeforeNode (Node *before_node, Block *block) |
|
void | inlineLoopCondition (Node *n) |
|
void | inlineLoopCondition (Block *block) |
|
void | InlineLoopCondition (std::shared_ptr< Graph > &graph) |
|
NoneStatus | canBeNone (Value *v) |
|
static Value * | asSimple (const SugaredValuePtr &value) |
|
static std::shared_ptr< MagicMethod > | makeMagic (const std::string &name, SugaredValuePtr base) |
|
template<class T > |
static Value * | materializeConstant (T val, Graph &graph, const SourceRange &r, std::unordered_map< T, Value * > &map) |
|
bool | isSupportedListElementType (const TypePtr &type) |
|
void | runCleanupPasses (std::shared_ptr< Graph > &to_clean) |
|
bool | meaningfulName (const std::string &name) |
|
C10_EXPORT int | stringToKind (const std::string &str) |
|
C10_EXPORT std::string | kindToString (int kind) |
|
C10_EXPORT SharedParserData & | sharedParserData () |
|
bool | isCharCount (char c, const std::string &str, size_t start, int len) |
|
c10::optional< char > | parseOctal (const std::string &str, size_t pos) |
|
std::string | parseStringLiteral (const SourceRange &range, const std::string &str) |
|
Decl | mergeTypesFromTypeComment (const Decl &decl, const Decl &type_annotation_decl, bool is_method) |
|
std::shared_ptr< NativeResolver > | nativeResolver () |
|
static TypePtr | unwrapOptional (TypePtr opt_type) |
|
static bool | isIntOrFloatUsedAsList (const Value *value, const Argument &arg) |
|
bool | convertibleToList (const TypePtr &type, const TypePtr &list_type_) |
| Returns true if type is a Tuple in which all the elements have the same type or if it's a subtype of list_type_ . More...
|
|
Value * | tryConvertToType (const SourceRange &loc, Graph &graph, const TypePtr &concrete_type, Value *value, bool allow_conversions) |
|
static Value * | tryMatchArgument (const Argument &arg, Graph &graph, const SourceRange &loc, const NamedValue &named_value, std::ostream *failure_messages, const std::function< std::ostream &()> &err, bool allow_conversions, TypeEnv &type_env) |
|
c10::optional< size_t > | findInputWithName (const std::string &name, at::ArrayRef< NamedValue > kwargs) |
|
static Value * | tryCreateList (const TypePtr &elem_type, Graph &graph, const SourceRange &loc, at::ArrayRef< NamedValue > varargs, std::ostream *failure_messages, const std::function< std::ostream &()> &err, bool convert_tensor_to_num, TypeEnv &type_env) |
| Creates a list with the provided values if each value's type can be matched to an argument with type elem_type . More...
|
|
static bool | varargsCanBeUsedAsList (const FunctionSchema &schema, size_t arg_index, const Argument &arg) |
|
bool | isBlockListedSchema (const FunctionSchema &schema) |
|
static c10::optional< MatchedSchema > | tryMatchSchema (const FunctionSchema &schema, const SourceRange &loc, Graph &graph, at::ArrayRef< NamedValue > args, at::ArrayRef< NamedValue > kwargs, c10::optional< NamedValue > self, std::ostream *failure_messages, bool allow_conversions) |
|
MatchedSchema | matchSchema (const ::c10::FunctionSchema &schema, const SourceRange &loc, Graph &graph, at::ArrayRef< NamedValue > args, at::ArrayRef< NamedValue > kwargs, const c10::optional< NamedValue > &self) |
|
MatchedSchema | matchSchema (const ::c10::FunctionSchema &schema, const SourceRange &loc, Graph &graph, at::ArrayRef< Value * > args, at::ArrayRef< NamedValue > kwargs) |
|
static std::string | prefixLine (const std::string &str, const std::string &prefix) |
|
std::pair< size_t, MatchedSchema > | matchSchemas (const std::vector< const FunctionSchema * > &schemas, const SourceRange &loc, Graph &graph, at::ArrayRef< NamedValue > args, at::ArrayRef< NamedValue > kwargs, const c10::optional< NamedValue > &self, bool render_errors) |
|
static Value * | packOutputs (Graph &g, at::ArrayRef< Value * > values, c10::OptNameList field_names) |
|
static Value * | emitBuiltinNode (const MatchedSchema &matched_schema, const SourceRange &loc, Graph &graph, Symbol name) |
|
Value * | emitBuiltinCall (const SourceRange &loc, Graph &graph, Symbol name, at::ArrayRef< NamedValue > args, at::ArrayRef< NamedValue > kwargs, const c10::optional< NamedValue > &self) |
|
TORCH_API std::pair< size_t, MatchedSchema > | matchSchemas (const std::vector< const ::c10::FunctionSchema * > &schemas, const SourceRange &loc, Graph &graph, at::ArrayRef< NamedValue > args, at::ArrayRef< NamedValue > kwargs, const c10::optional< NamedValue > &self=c10::nullopt, bool render_errors=false) |
|
const std::unordered_map< std::string, TypePtr > & | string_to_type_lut () |
|
C10_EXPORT void | format_stack_trace (std::ostream &out, const std::vector< StackEntry > &entries) |
|
std::ostream & | operator<< (std::ostream &out, const SourceRange &range) |
|
C10_EXPORT double | strtod_c (const char *nptr, char **endptr) |
|
C10_EXPORT float | strtof_c (const char *nptr, char **endptr) |
|
static const std::unordered_map< std::string, at::ScalarType > & | builtin_cast_method_to_scalar_type () |
|
static bool | isRecursive (const TypePtr &classType, const TypePtr &attrType) |
|
static std::vector< Value * > | toValues (Graph &g, at::ArrayRef< NamedValue > nvs) |
|
static SourceRange | mergeRanges (SourceRange c, const TreeList &others) |
|
static std::ostream & | operator<< (std::ostream &out, pretty_tree t_) |
|
static std::ostream & | operator<< (std::ostream &out, const TreeRef &t) |
|
static std::unordered_map< Symbol, SymbolRange > | symbol_range_map ({ {Symbol::fromQualString("aten::_test_serialization_subcmul"), {0, 2, Symbol::fromQualString("upgraders::_test_serialization_subcmul_0_2")}}, {Symbol::fromQualString("aten::div"), {0, 3, Symbol::fromQualString("upgraders::div_0_3")}}, {Symbol::fromQualString("aten::div_"), {0, 3, Symbol::fromQualString("upgraders::div__0_3")}}, {Symbol::fromQualString("aten::full"), {0, 4, Symbol::fromQualString("upgraders::full_0_4")}}, }) |
|
static std::unordered_map< NodeKind, uint64_t > | kind_min_version_map ({ {aten::div, 4}, {aten::div_, 4}, {aten::full, 5}, }) |
|
Symbol | get_symbol_for_version (const Symbol name, const uint64_t version) |
|
uint64_t | get_min_version_for_kind (const NodeKind &kind) |
|
void | Lint (const AliasDb *db) |
|
static const char * | toString (AttributeKind kind) |
|
bool | insertableTensor (const at::Tensor &ten) |
|
bool | insertableIValue (const IValue &ivalue) |
|
Value * | insertConstant (Graph &g, const IValue &val, c10::optional< SourceRange > loc, c10::optional< ScopePtr > scope) |
|
c10::optional< Value * > | tryInsertConstant (Graph &g, const IValue &val, c10::optional< SourceRange > loc, c10::optional< ScopePtr > scope) |
|
c10::optional< IValue > | toIValue (const Value *v) |
|
template<typename T > |
c10::optional< T > | constant_as (const Value *v) |
|
template<typename T > |
static bool | operator== (generic_graph_node_list_iterator< T > a, generic_graph_node_list_iterator< T > b) |
|
template<typename T > |
static bool | operator!= (generic_graph_node_list_iterator< T > a, generic_graph_node_list_iterator< T > b) |
|
static void | printValueRef (std::ostream &out, const Value *n) |
|
template<typename T > |
std::ostream & | operator<< (std::ostream &out, const std::vector< T > &nodes) |
|
template<typename T > |
static std::ostream & | printValueRefs (std::ostream &out, const at::ArrayRef< T > nodes) |
|
std::ostream & | operator<< (std::ostream &out, const at::ArrayRef< const Value * > nodes) |
|
std::ostream & | operator<< (std::ostream &out, const at::ArrayRef< Value * > nodes) |
|
std::ostream & | operator<< (std::ostream &out, const const_value_list_with_types &l) |
|
static void | printAttribute (std::ostream &out, const at::Tensor &tensor) |
|
static void | printAttribute (std::ostream &out, const IValue &ival) |
|
static void | printTypeList (std::ostream &out, const std::vector< TypePtr > &items) |
|
static std::ostream & | indent (std::ostream &out, size_t level) |
|
std::ostream & | operator<< (std::ostream &out, const Node &n) |
|
std::ostream & | operator<< (std::ostream &out, const Graph &g) |
|
static void | checkSameDevice (const Node *node) |
|
void | LintGraph (const std::shared_ptr< Graph > &graph) |
|
size_t | findArgument (const FunctionSchema &the_schema, const std::string &unqualName) |
|
size_t | findArgument (const FunctionSchema &the_schema, Symbol name) |
|
const SourceRange & | fakeRange () |
|
at::ArrayRef< Value * > | createTupleUnpack (Value *v) |
|
std::vector< Value * > | inlineCallTo (Node *to_replace, Function *callee, bool use_graph=true) |
| Insert function CALLEE after node TO_REPLACE , remove the node and replace all its uses with corresponding outputs of the inserted function. More...
|
|
std::vector< Value * > | unpackOutputs (const std::vector< Value * > &outputs) |
| If there is only one value in OUTPUTS and its kind is Tuple, insert a tuple unpack node and return the resulting values. More...
|
|
std::vector< Value * > | insertGraph (Graph &g, Graph &callee, ArrayRef< Value * > inputs, std::unordered_map< Value *, Value * > &value_map) |
|
std::vector< Value * > | insertGraph (Graph &g, Graph &callee, ArrayRef< Value * > inputs) |
| Insert graph CALLEE into graph G using INPUTS as input values. More...
|
|
void | parseIR (const std::string &str, torch::jit::Graph *graph, std::unordered_map< std::string, Value * > &vmap) |
| Parse IR from STR constructing the corresponding IR in\ GRAPH. More...
|
|
void | parseIR (const std::string &str, torch::jit::Graph *graph) |
|
std::vector< Match > | findPatternMatches (const Graph &pattern, Graph &graph) |
|
std::string | getHeader (const Node *node) |
|
static std::unordered_map< std::string, size_t > | parseJITLogOption (const char *option) |
|
bool | is_enabled (const char *cfname, JitLoggingLevels level) |
|
std::string | log_function (const std::shared_ptr< torch::jit::Graph > &graph) |
|
std::string | jit_log_prefix (const std::string &prefix, const std::string &in_str) |
|
std::string | jit_log_prefix (JitLoggingLevels level, const char *fn, int l, const std::string &in_str) |
|
std::ostream & | operator<< (std::ostream &out, JitLoggingLevels level) |
|
TORCH_API::torch::jit::JitLoggingLevels | jit_log_level () |
|
TORCH_API std::string | jit_log_prefix (::torch::jit::JitLoggingLevels level, const char *fn, int l, const std::string &in_str) |
|
TORCH_API bool | is_enabled (const char *cfname, ::torch::jit::JitLoggingLevels level) |
|
TORCH_API std::ostream & | operator<< (std::ostream &out, ::torch::jit::JitLoggingLevels level) |
|
std::unordered_map< std::string, int64_t > & | passes_to_current_counter () |
|
static int | parseOptLimit (const std::string &opt_limit) |
|
static std::unordered_map< std::string, int64_t > | parseJITOptLimitOption (const char *option) |
|
bool | opt_limit (const char *pass_name) |
|
void | _save_parameters (const std::map< std::string, at::Tensor > &map, std::ostream &out) |
|
void | _save_parameters (const std::map< std::string, at::Tensor > &map, const std::string &filename) |
|
char const * | toString (OpCode op) |
|
OpCode | parseOpCode (const char *str) |
|
IValue | expect_field (IValue tup, const std::string &expected_name, size_t entry) |
|
std::string | operator_str (const std::string &name, const std::string &overloadname) |
|
mobile::Module | _load_for_mobile (std::istream &in, c10::optional< at::Device > device) |
|
mobile::Module | _load_for_mobile (const std::string &filename, c10::optional< at::Device > device) |
|
mobile::Module | _load_for_mobile (std::unique_ptr< ReadAdapterInterface > rai, c10::optional< c10::Device > device) |
|
mobile::Module | _load_for_mobile (std::istream &in, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
mobile::Module | _load_for_mobile (const std::string &filename, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
mobile::Module | _load_for_mobile (std::unique_ptr< ReadAdapterInterface > rai, c10::optional< c10::Device > device, ExtraFilesMap &extra_files) |
|
void | _load_extra_only_for_mobile (const std::string &filename, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
| Load only the contents of the "extra/" files whose names are passed in the map (extra_files). More...
|
|
std::map< std::string, at::Tensor > | _load_parameters (std::istream &in, c10::optional< at::Device > device) |
|
std::map< std::string, at::Tensor > | _load_parameters (const std::string &filename, c10::optional< at::Device > device) |
|
std::map< std::string, at::Tensor > | _load_parameters (std::unique_ptr< ReadAdapterInterface > rai, c10::optional< c10::Device > device) |
|
std::ostream & | operator<< (std::ostream &out, Instruction inst) |
|
void | AnnotateWarns (Block *b) |
|
void | AnnotateWarns (const std::shared_ptr< Graph > &graph) |
|
static bool | shouldBeCapturedInByBailOut (Node *n) |
|
void | InsertBailOuts (std::shared_ptr< Graph > graph) |
|
static Node * | locateBailOutNodeInUnoptimizedGraph (Block *b, int64_t index) |
|
static void | removeBailouts (Block *b) |
|
TORCH_API std::shared_ptr< Graph > | BuildBailOutGraphFrom (int64_t bailout_index, const std::shared_ptr< Graph > &orig, const std::shared_ptr< Graph > &target) |
|
bool | have_same_shape (at::TensorList inputs) |
|
bool | should_be_transposed (at::TensorList inputs) |
|
std::vector< at::Tensor > | transpose_inputs (at::TensorList inputs) |
|
bool | shape_is_fast_for_reduce (const at::Tensor &lhs, const at::Tensor &rhs) |
|
void | BatchMMTreeReduce (Block *block) |
|
bool | shape_is_fast_for_side (const at::Tensor &other_side_input) |
|
std::pair< std::vector< Node * >, std::vector< Node * > > | gatherIndependentMMUses (Value *value, AliasDb &alias_db) |
|
void | BatchMMSide (Block *block, AliasDb &alias_db) |
|
bool | hasMutableOperators (Block *block) |
|
void | BatchMM (std::shared_ptr< Graph > &graph) |
|
std::shared_ptr< Graph > | Canonicalize (const std::shared_ptr< Graph > &graph, bool keep_unique_names) |
|
size_t | blockIndex (const Block *b) |
|
bool | isBefore (Node *n1, Node *n2) |
|
bool | isBefore (const Use &a, const Use &b) |
|
bool | isAfter (const Use &a, const Use &b) |
|
bool | isBeforeOrAfter (const Use &a, const Use &b, bool checking_before) |
|
c10::optional< const Use > | firstOrLastUse (Value *v, bool find_first) |
|
std::vector< c10::optional< const Use > > | gatherFirstUses (at::ArrayRef< Value * > values) |
|
std::vector< size_t > | sort_indexes (at::ArrayRef< Value * > values) |
|
void | CanonicalizeLoopOutputs (Node *n) |
|
void | CanonicalizeIfOutputs (Node *n) |
|
void | CanonicalizeOutputs (Block *block) |
|
void | CanonicalizeOutputs (std::shared_ptr< Graph > &graph) |
|
static c10::optional< std::vector< ChunkOutput > > | getChunkOutputs (Node *chunk) |
|
static void | CanonicalizeOps (Block *block) |
|
void | CanonicalizeOps (const std::shared_ptr< Graph > &graph) |
|
static void | unprofileGraphInputs (const std::shared_ptr< Graph > &graph) |
|
static void | unprofileBlock (Block *start_block) |
|
void | ClearProfilingInformation (const std::shared_ptr< Graph > &graph) |
|
void | clearUndefinedness (Value *o) |
|
void | clearUndefinedness (Block *block) |
|
void | ClearUndefinedness (const std::shared_ptr< Graph > &graph) |
|
void | EliminateCommonSubexpression (const std::shared_ptr< Graph > &graph) |
|
void | ConstantPooling (const std::shared_ptr< Graph > &graph) |
|
c10::optional< std::vector< IValue > > | runNodeIfInputsAreConstant (const Node *n, bool ignore_custom_classes) |
|
void | ConstantPropagation (std::shared_ptr< Graph > &graph, bool ignore_custom_classes) |
|
void | ConstantPropagationImmutableTypes (std::shared_ptr< Graph > &graph) |
|
std::vector< Node * > | CreateAutodiffSubgraphs (const std::shared_ptr< Graph > &graph, size_t threshold) |
|
void | CreateFunctionalGraphs (const std::shared_ptr< Graph > &graph) |
|
void | InlineFunctionalGraphs (const std::shared_ptr< Graph > &graph) |
|
void | EliminateDeadCode (const std::shared_ptr< Graph > &graph, DCESideEffectPolicy sideEffectPolicy) |
|
void | EliminateDeadCode (Block *block, bool recurse, DCESideEffectPolicy sideEffectPolicy) |
|
void | EliminateDeadCode (Block *block, std::function< void(const std::unordered_set< const Value * > &)> cb, DCESideEffectPolicy sideEffectPolicy) |
|
c10::optional< bool > | isDefined (Value *tensor) |
|
bool | isDecomposableNorm (Node *normalize_op) |
|
bool | DecomposeOps (Block *block, CompilationUnit &decompose_funcs) |
|
void | DecomposeOps (std::shared_ptr< Graph > &graph) |
|
static void | EraseNumberTypesOnBlock (Block *block) |
|
void | EraseNumberTypes (const std::shared_ptr< Graph > &graph) |
|
void | FixupTraceScopeBlocks (std::shared_ptr< Graph > &graph, Module *self) |
|
std::tuple< at::Tensor, at::Tensor > | computeUpdatedConvWeightAndBias (const ConvBNParameters &p) |
| Given the current weight and bias tensors of a Conv module and parameters of the BatchNorm module we're folding with, compute the updated values for the weight and bias. More...
|
|
Module | FoldConvBatchNorm (const Module &module) |
| Fold Conv2d-BatchNorm2d into Conv2d in forward method of this module and all its submodules. More...
|
|
Module | freeze_module (const Module &module, std::vector< std::string > preservedAttrs, bool freezeInterfaces, bool preserveParameters) |
|
bool | nonConstantParameters (Node *n) |
|
bool | supportedConvNode (Node *n) |
|
void | FoldFrozenConvBatchnorm (Block *b) |
|
bool | supportedAddOrSub (Node *n) |
|
bool | opDoesNotBroadCastWithConv (Tensor &op_tensor, Tensor &weight_tensor) |
|
bool | checkConvAndBroadcastingOpPreConditions (Node *conv, Node *op) |
|
Tensor | resizeConstantScalarOrTensorToShape (Value *v, const std::vector< int64_t > &shape, at::TensorOptions options) |
|
void | FoldFrozenConvAddOrSub (Block *b) |
|
bool | supportedMulOrDiv (Node *n) |
|
void | FoldFrozenConvMulOrDiv (Block *b) |
|
void | FoldFrozenConvBatchnorm (std::shared_ptr< Graph > &graph) |
|
void | FoldFrozenConvAddOrSub (std::shared_ptr< Graph > &graph) |
|
void | FoldFrozenConvMulOrDiv (std::shared_ptr< Graph > &graph) |
|
void | OptimizeFrozenGraph (std::shared_ptr< Graph > &graph, bool optimize_numerics) |
|
void | FuseLinear (std::shared_ptr< Graph > &graph) |
| Match the at::linear pattern and fuse it into a single at::linear This pass fuse the addmm or matmul + add generated by JIT back to linear This pass can be deleted once the JIT can emit the aten::linear in the future. More...
|
|
void | FuseAddRelu (script::Module &module) |
|
void | FuseAddRelu (std::shared_ptr< Graph > &graph) |
|
void | FuseGraph (std::shared_ptr< Graph > &graph, bool strict_fuser_check) |
|
void | CustomFuseGraph (std::shared_ptr< Graph > &graph, const std::function< bool(Node *)> &fn, Symbol kind, size_t arg_limit) |
|
void | EliminateRedundantGuards (std::shared_ptr< Graph > graph) |
|
void | hoistConvPackedParams (Module &rootModule, Node *getConvPackedParamsNode, const std::string &prefix, int &nameUniqueCounter) |
|
void | HoistConvPackedParams (script::Module &m) |
|
bool | canRunWithAutograd (Node *node) |
|
void | InlineAutodiffSubgraphs (std::shared_ptr< Graph > &graph, size_t threshold) |
|
void | InlineForkWait (Block *b, std::unordered_map< Value *, Value * > &future_remap) |
|
void | InlineForkWait (const std::shared_ptr< Graph > &graph) |
|
void | inlineForkedClosure (Node *fork_closure) |
|
void | inlineForkedClosures (Block *block) |
|
void | inlineForkedClosures (std::shared_ptr< Graph > &to_clean) |
|
void | inlineCalls (Block *block) |
|
void | Inline (Graph &graph) |
|
void | CheckInplace (Block *block) |
|
void | CheckInplace (std::shared_ptr< Graph > &graph) |
|
void | removeProfilingNodes (Block *b) |
|
void | InsertGuards (std::shared_ptr< Graph > graph) |
|
void | RemoveProfilingNodes (const std::shared_ptr< Graph > &graph) |
|
void | liftClosure (Node *closure) |
|
void | liftClosures (Block *block) |
|
void | liftClosures (const std::shared_ptr< Graph > &to_clean) |
|
std::unordered_map< Node *, std::vector< Value * > > | BuildLivenessSets (std::shared_ptr< Graph > graph) |
|
static void | addCondAsOutput (Node *loop) |
|
void | PeelProfilingLoops (const std::shared_ptr< Graph > &graph) |
|
Node * | PeelLoop (Node *n, size_t times) |
|
void | UnrollLoops (std::shared_ptr< Graph > &graph) |
|
void | LowerGradOf (Graph &g) |
|
std::pair< std::shared_ptr< Graph >, std::vector< Slot > > | lower_graph (const ModulePtr &self, Graph &g_, size_t self_offset=0) |
|
static std::vector< IValue > | loadTensors (const std::vector< Slot > &slots) |
|
std::pair< std::shared_ptr< Graph >, std::vector< IValue > > | LowerGraph (Graph &graph, const ModulePtr &self) |
|
static void | LowerAllTuples (Block *block) |
|
static void | RemoveTupleConstants (Node *n) |
|
static void | VisitNode (Node *n, Node *insert_point) |
|
static void | EnsureNoTuples (ArrayRef< Value * > values) |
|
static void | EnsureNoTuples (Block *block) |
|
void | LowerAllTuples (const std::shared_ptr< Graph > &graph) |
|
void | LowerSimpleTuples (Block *block) |
|
void | LowerSimpleTuples (const std::shared_ptr< Graph > &graph) |
|
void | metalInsertPrePackedOps (std::shared_ptr< Graph > &graph) |
|
void | metalInsertPrePackedOps (script::Module &module) |
|
void | metalFoldPrePackingOps (script::Module &m) |
|
void | metalFusePrePackedConvWithClamp (script::Module &module) |
|
void | metalInsertCopyOps (script::Module &module) |
|
void | runCanonicalOptimizations (script::Module &module) |
|
script::Module | metalOptimizeForMobile (const script::Module &m, const std::vector< std::string > &preserved_methods) |
|
const std::unordered_map< Symbol, Symbol > & | getOperatorAliasMap () |
|
void | NormalizeOps (const std::shared_ptr< Graph > &graph) |
|
void | removePrintOps (Block *block) |
|
void | RemovePrintOps (std::shared_ptr< Graph > &graph) |
|
void | checkONNXCompatibility (const c10::FunctionSchema &schema) |
|
void | preprocessCaffe2Ops (Block *block) |
|
void | PreprocessCaffe2Ops (std::shared_ptr< Graph > &graph) |
|
std::shared_ptr< Graph > | ToONNX (std::shared_ptr< Graph > &graph, ::torch::onnx::OperatorExportTypes operator_export_type) |
|
void | BlockToONNX (Block *old_block, Block *new_block, ::torch::onnx::OperatorExportTypes operator_export_type, std::unordered_map< Value *, Value * > env) |
|
void | CastAllConstantToFloating (Block *block) |
|
void | CastAllConstantToFloating (const std::shared_ptr< Graph > &graph) |
|
void | ConstantFoldONNX (Block *b, ParamMap ¶msDict, int opset_version) |
|
void | ConstantFoldONNX (Block *b, std::map< std::string, IValue > ¶mDict, int opset_version) |
|
void | EliminateUnusedItemsONNX (Block *b, ParamMap ¶msDict) |
|
void | EliminateUnusedItemsONNX (Block *b, std::map< std::string, IValue > ¶mDict) |
|
std::vector< at::Tensor > | getValues (Node *node, const ValueToParamPairMap &valsToParamsMap) |
|
static void | fuseConvBatchNorm (Block *b, ValueToParamPairMap &valsToParamsMap) |
|
void | EvalPeepholeONNX (Block *b, ParamMap ¶msDict) |
|
void | EvalPeepholeONNX (Block *b, std::map< std::string, IValue > ¶mDict) |
|
void | FixupONNXLoopNodeInputs (Node *node) |
|
std::vector< Value * > | FixupONNXLoopNode (Node *node, int opset_version) |
|
bool | IsUninitializedNode (Node *n) |
|
void | InferShapeTypeForUninitializedOutput (Graph *graph, Block *block, Value *uninitialized_output, Value *other_output) |
|
void | ONNXFixupUninitializedOutput (Node *node) |
|
std::vector< Value * > | FixupONNXIfNode (Node *node, int opset_version) |
|
std::vector< Value * > | FixupONNXControlflowNode (Node *n, int opset_version) |
|
static bool | isStaticCondition (Node *node) |
|
static c10::optional< int > | findIndex (c10::ArrayRef< torch::jit::Value * > outputs, Value *input) |
|
static bool | constantFoldedConditionValue (Node *node) |
|
static void | foldIfNode (Block *b) |
|
void | FoldIfNodeONNX (Block *b) |
|
bool | ConditionValueONNX (Node *n) |
|
bool | IsStaticConditionONNX (Node *n) |
|
void | functionCallSubstitution (Block *block) |
|
void | ONNXFunctionCallSubstitution (Graph &graph) |
|
ValueToParamPairMap | buildValueToParamsMap (Block *b, const ParamMap ¶msDict) |
|
void | eraseUnusedBlockInputs (Block *b) |
|
void | eraseUnusedValuesFromMap (ValueToParamPairMap &valsToParamsMap) |
|
void | buildParamsMapFromValueToParamsMap (const ValueToParamPairMap &valsToParamsMap, ParamMap ¶msDict) |
|
c10::optional< at::ScalarType > | ONNXTypeToATenType (int32_t onnx_type) |
|
Node * | addNodeToBlock (Block *block, Symbol kind, ArrayRef< Value * > inputs) |
|
Value * | addInputToBlock (Block *block) |
|
Node * | createONNXUnsqueeze (Graph *graph, Node *n_to_insert_before, Value *input, int axis, int opset_version) |
|
std::deque< std::string > | findSubModuleAttr (Value *input, std::string &name, Module &attrModule, std::shared_ptr< Graph > &graph) |
|
Value * | addParamAsArgument (Function *function, std::string &name, IValue &attr) |
|
std::vector< IValue > | getParamAttributes (Block *block, std::shared_ptr< Graph > &graph, const Module &module_, Function *function_, std::unordered_map< std::string, Value * > &attrValues) |
|
void | insertMainModuleAsConstant (const std::shared_ptr< Graph > &graph) |
|
std::pair< Module, std::vector< IValue > > | list_module_parameters (const Module &module) |
|
bool | isRNN (const Node *node) |
|
bool | isNopTranspose (const std::vector< int64_t > &perm) |
|
std::vector< int64_t > | composeTransposes (const std::vector< int64_t > &t1, const std::vector< int64_t > &t2) |
|
std::vector< size_t > | getBroadcastPositions (Node *node) |
|
c10::optional< size_t > | fusibleExpandTo (at::IntArrayRef from, at::IntArrayRef to) |
|
void | fuseBroadcast (Block *b) |
|
void | fuseConsecutiveTransposes (Block *b) |
|
void | eliminateNopTranspose (Block *b) |
|
void | fuseTransposeIntoGemm (Block *b) |
|
void | pushPackingPastRnn (Block *b) |
|
void | removeNopPacking (Block *graph) |
|
void | hackFixupPadPackedShapes (Block *graph) |
|
void | fixDefaultRNNState (Graph *graph, Node *n, int input_index, int opset_version) |
|
void | fixDefaultRnnHiddenState (Block *b, int opset_version) |
|
void | fixDefaultLstmCellState (Block *b, int opset_version) |
|
static bool | isSafeToSpeculate (Node *n) |
|
static void | speculateOps (Block *block) |
|
static void | replaceInputWithList (Node *node, size_t i, ArrayRef< Value * > to) |
|
static void | eraseListConstruct (Block *block, int opset_version) |
|
static void | eraseListConstruct (Node *n, int opset_version) |
|
static void | fuseListConstructListUnpack (Block *b) |
|
void | removeMaxPoolUnusedOutput (Block *b) |
|
static void | fuseLogSoftmaxNllLoss (Block *b) |
|
static void | removeSequenceSplitConcat (Block *b) |
|
void | PeepholeOptimizeONNX (std::shared_ptr< Graph > &graph, int opset_version, bool fixed_batch_size) |
|
static void | PrepareDivisionForONNXOnBlock (Block *block) |
|
void | PrepareDivisionForONNX (const std::shared_ptr< Graph > &graph) |
|
void | PreprocessForONNX (std::shared_ptr< Graph > &graph) |
|
void | PrepareInplaceOpsForONNX (const std::shared_ptr< Graph > &graph) |
|
void | RemoveInplaceOpsForONNX (const std::shared_ptr< Graph > &graph, Module *model=nullptr) |
|
void | ScalarTypeAnalysisForONNX (const std::shared_ptr< Graph > &graph) |
|
void | ScalarTypeAnalysisNodeForONNX (Node *n) |
|
TypePtr | MergeInferredType (TypePtr existing_type, TypePtr inferred_type) |
|
void | ONNXShapeTypeInference (Node *n, const ParamMap ¶ms_dict, int opset_version) |
|
void | ONNXSetDynamicInputShape (std::shared_ptr< Graph > &graph, const std::unordered_map< std::string, std::unordered_map< int64_t, std::string > > &dynamic_axes, const std::vector< std::string > &input_names) |
|
bool | HasSequenceTypeOutput (Node *node) |
|
void | ONNXUpdateTypeFromTensor (Value *graph_output, const at::Tensor &output, bool onnx_shape_inference) |
|
size_t | ONNXAssignOutputShape (std::shared_ptr< Graph > &graph, size_t outputs_index, PyObject *output_obj, bool onnx_shape_inference) |
|
void | ONNXAssignOutputShape (std::shared_ptr< Graph > &graph, at::ArrayRef< at::Tensor > outputs, const python::IODescriptor &desc, bool onnx_shape_inference) |
|
void | ONNXShapeTypeInference (std::shared_ptr< Graph > &graph, const ParamMap ¶ms_dict, int opset_version) |
|
double | getScaleFromInput (Node *input_node) |
|
Node * | CreateQuantizedWeights (std::string data, std::shared_ptr< Graph > &graph, std::vector< int64_t > shapes, double scale, int64_t zero_point) |
|
Node * | CreateQuantizedBias (std::vector< int64_t > data, std::shared_ptr< Graph > &graph, std::vector< int64_t > shapes, double scale, int64_t zero_point) |
|
Node * | createIntTuple (const std::vector< int64_t > &is, std::shared_ptr< Graph > &graph) |
|
Node * | createInt (int64_t i, std::shared_ptr< Graph > &graph) |
|
void | unpackQuantizedWeightsHelper (std::shared_ptr< Graph > &graph, std::map< std::string, IValue > ¶msDict, const std::string &pattern, const std::string &unpack_fn, QuantizedParamsType params_type) |
|
void | UnpackQuantizedWeights (std::shared_ptr< Graph > &graph, std::map< std::string, IValue > ¶msDict) |
|
void | insertPermutesHelper (std::shared_ptr< Graph > &graph, std::map< std::string, IValue > ¶msDict, const std::string &pattern) |
|
void | insertPermutes (std::shared_ptr< Graph > &graph, std::map< std::string, IValue > ¶msDict) |
|
std::vector< GraphPassEntry > & | getCustomPostPasses () |
|
std::vector< GraphPassEntry > & | getCustomPrePasses () |
|
GraphPassNameType | registerPostPass (GraphPass p) |
|
GraphPassNameType | registerPass (GraphPass p) |
|
GraphPassNameType | registerPrePass (GraphPass p) |
|
void | clearPostPass (GraphPassNameType pid) |
|
void | clearPrePass (GraphPassNameType pid) |
|
void | clearAllPostPasses () |
|
void | clearAllPrePasses () |
|
template<typename T > |
static bool | mustBeEqual (const c10::optional< T > &a, const c10::optional< T > &b) |
|
void | FuseAddMM (Block *block) |
|
void | FuseAddMM (const std::shared_ptr< Graph > &graph) |
|
void | PeepholeOptimize (const std::shared_ptr< Graph > &graph, bool addmm_fusion_enabled) |
|
TORCH_API void | PeepholeOptimize (Block *block, bool disable_shape_peepholes=false) |
|
void | PeepholeOptimizeAliasSensitive (const std::shared_ptr< Graph > &graph) |
|
c10::optional< size_t > | normalizeIndex (int64_t index, size_t len) |
|
void | PeepholeOptimizeListIdioms (const std::shared_ptr< Graph > &graph) |
|
void | PrePackingOpsFolder (script::Module &m, const PrePackingOpsFilterFn &is_foldable_op, const std::string &attr_prefix) |
|
void | DedupModuleUses (Module &module) |
| Recursively deduplicate multiple uses of the same module by creating an instance clone for each use of the module, which means the type will be the same as before and all the attributes will be copied, then we'll change the use of the original module to the use of cloned module in the Graph. More...
|
|
void | QuantFusion (std::shared_ptr< Graph > &graph, QuantType quant_type=QuantType::STATIC) |
| Backend specific pass to fuse dequantize - op - quantize calls as quantized_op calls. More...
|
|
void | InsertPrepackUnpack (std::shared_ptr< Graph > &graph) |
| Insert prepack and unpack function in graph We want add pack/unpack functions for quantized weight because later we want to fold the packed weight as an attribute of the module, in order to reduce the cost of packing the weight on the fly in quantized models. More...
|
|
void | InsertPrepackUnpack (Module &module) |
| Insert pack and unpack function in all graphs of module. More...
|
|
void | FoldQuantizedPrepackingOps (Module &module) |
|
Module | Finalize (Module &module, QuantType quant_type, const std::vector< std::string > &preserved_attrs) |
|
void | FuseQuantizedAddRelu (std::shared_ptr< Graph > &graph) |
|
bool | matchAtenFuncToUse (const Use &use, const std::string &func_name, c10::optional< int > n) |
|
bool | matchCallFuncToUse (const Use &use, const std::string &func_name, c10::optional< int > n) |
|
bool | matchArgPattern (Value *v, const AtenFuncArgs &aten_func_args, const CallFuncArgs &call_func_args) |
|
bool | isWeight (Value *v) |
|
bool | isBiasOfConvOrLinear (Value *v) |
|
bool | isEmbeddingBagNonInput (Value *v) |
|
c10::optional< Use > | getClampScalarInputUse (Value *v) |
|
std::vector< Value * > | getPassThroughInputs (Value *v) |
|
std::vector< NodeKind > | toAtenSymbol (const std::vector< std::string > &func_names) |
|
bool | isAtenFunc (Node *n, const std::vector< NodeKind > &aten_funcs) |
|
bool | isAtenFunc (Node *n, const std::vector< std::string > &aten_funcs) |
|
bool | isFunctionNode (Node *n, const std::vector< std::string > &call_funcs, const std::vector< std::string > &aten_funcs) |
|
bool | isSingleInputGeneralShapeAtenFunction (Node *n) |
|
bool | isSingleInputGeneralValueAtenFunction (Node *n) |
|
bool | isSingleInputGeneralCallFunction (Node *n) |
|
bool | isSingleInputGeneralAtenFunction (Node *n) |
|
bool | isClamp (Node *n) |
|
bool | isTensorInfoNode (Node *n) |
|
bool | isPropagateQuantSingleInputOp (Node *n) |
|
bool | isPropagateQuantBinaryOp (Node *n) |
|
bool | isPropagateQuantOp (Node *n) |
|
bool | isBinaryOpWithScalarInput (Node *n) |
|
c10::optional< std::tuple< c10::QScheme, QParamVector > > | getFixedQParams (Node *n) |
|
bool | userDefinedCallFunction (Node *n) |
|
bool | isWeightOnlyStaticQuantOp (Node *n) |
|
bool | nodeQuantizable (Node *n, QuantType quant_type) |
|
bool | useQuantizable (const Use &use, QuantType quant_type) |
|
std::shared_ptr< Graph > | getCallFunctionGraph (Node *n) |
|
bool | alwaysRaisesException (Block *block) |
|
bool | isScalar (Value *v) |
|
bool | hitGraphInput (Value *value) |
|
std::vector< std::string > | getModuleAccessPath (Value *instance, Value *self) |
|
Module | findChildModule (const Module &module, const std::vector< std::string > &path) |
|
Module | getInvokedModule (Module &module, Node *n, Value *self) |
|
c10::optional< Module > | getInvokedModuleOpt (const Module &module, Node *n, Value *self) |
|
bool | is_int_constant (const Match &match, const std::unordered_map< std::string, Value * > &vmap, const std::string &vname, int value) |
|
bool | is_functional (const Match &match, const std::unordered_map< std::string, Value * > &vmap, const std::string &vname, const std::string &functional) |
|
std::string | removeTorchMangle (const std::string &orig_name) |
|
c10::optional< std::string > | getModuleName (Value *value) |
|
bool | is_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap, const std::string &vname, const std::string &module_qualified_name) |
|
bool | aten_add_alpha_is_one (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_functional_relu (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_relu_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_functional_linear (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_linear_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_conv1d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_conv2d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_conv3d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_conv_transpose1d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_conv_transpose2d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_batchnorm2d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
bool | is_batchnorm3d_module (const Match &match, const std::unordered_map< std::string, Value * > &vmap) |
|
TORCH_API bool | hasScalarInput (Node *n) |
|
Module | InsertObservers (Module &module, const std::string &method_name, const QConfigDict &qconfig_dict, bool inplace, QuantType quant_type=QuantType::STATIC) |
| Insert observer module and observer function call for the Tensors that needs to be observed. More...
|
|
void | SwapFunctionalLinear (Module &module) |
| Swap all functional linear CallFunctions in module. More...
|
|
void | SwapFunctionalLinear (std::shared_ptr< Graph > &graph) |
| Swap functional linear CallFunctions to aten::linear so that it can survive inline, since quant fusion need to recognize linear as one op instead of a complicated if block. More...
|
|
void | ReplicateQuant (std::shared_ptr< Graph > &graph) |
| Replicate quantize node for prim::If blocks, so that we can match quantization patterns in prim::If blocks. More...
|
|
void | ReplicateDeQuant (std::shared_ptr< Graph > &graph) |
| Replicate dequantize node for each use, so that we can match quantization patterns. More...
|
|
Module | InsertQuantDeQuant (Module &module, const std::string &method_name, bool inplace, bool debug, QuantType quant_type=QuantType::STATIC) |
| Insert quantize - dequantize calls to the Tensors that are observed in insert_observers pass. More...
|
|
std::vector< QuantFusionInfo > | quant_fusion_pattern_and_replacements () |
|
std::vector< QuantFusionInfo > | dynamic_quant_fusion_pattern_and_replacements () |
|
std::vector< QuantFusionInfo > | linear_prepack_unpack_patterns () |
|
std::vector< QuantFusionInfo > | conv_prepack_unpack_patterns () |
|
std::ostream & | operator<< (std::ostream &os, QuantType t) |
|
void | removeDropout (script::Module &module) |
|
static void | RemoveExpands (Block *block) |
|
void | RemoveExpands (const std::shared_ptr< Graph > &graph) |
|
void | ImplicitCastForBinaryInplaceOps (Block *b) |
|
void | RemoveInplaceOps (const std::shared_ptr< Graph > &graph) |
|
void | RemoveListMutation (const std::shared_ptr< Graph > &graph) |
|
void | RemoveTensorMutation (const std::shared_ptr< Graph > &graph) |
|
void | RemoveRedundantProfiles (Block *block, AliasDb &db) |
|
void | RemoveRedundantProfiles (std::shared_ptr< Graph > &graph) |
|
void | PropagateRequiresGrad (std::shared_ptr< Graph > &graph) |
|
void | PropagateInputShapes (const std::shared_ptr< Graph > &graph) |
|
void | EraseShapeInformation (const std::shared_ptr< Graph > &graph) |
|
bool | hasGradSumToSizeUses (Value *v) |
|
void | insertProfileNodesForSpecializeAutogradZero (Block *block, ProfilingRecord *pr) |
|
void | InsertProfileNodesForSpecializeAutogradZero (ProfilingRecord *pr) |
|
void | specializeAutogradZero (std::shared_ptr< Graph > g) |
|
Module | PatternBasedRewrite (const Module &module) |
| Run pattern-based subgraph rewrites on all methods in the module. More...
|
|
bool | isSupportedForBlock (Node *node) |
|
bool | usedOnlyInSize (Value *v) |
|
Value * | broadcastSizes (at::ArrayRef< Value * > sizes, AliasDb *db) |
|
void | setTensorExprFuserEnabled (bool val) |
|
bool | tensorExprFuserEnabled () |
|
bool | setTexprReductionsEnabled (bool value) |
|
bool | texprReductionsEnabled () |
|
void | removeProfileNodesAndSpecializeTypes (Block *b) |
|
void | RemoveProfileNodesAndSpecializeTypes (std::shared_ptr< Graph > &graph) |
|
void | removeTensorTypeSpecialization (Value *v) |
|
void | removeTensorTypeSpecializations (Block *block) |
|
void | RemoveTensorTypeSpecializations (std::shared_ptr< Graph > &graph) |
|
void | insertTypeGuard (Node *guarded_node, tensor_type_converter_t type_converter, Symbol kind) |
|
void | FuseTensorExprs (std::shared_ptr< Graph > &graph, size_t min_group_size, bool disable_shape_checks) |
|
Operation | createTensorExprOp (const Node *node) |
|
void | UpdateDifferentiableGraphRequiresGrad (Block *block, c10::optional< bool > new_requires_grad) |
|
void | UpdateDifferentiableGraphRequiresGrad (std::shared_ptr< Graph > &diff_forward_graph, c10::optional< bool > new_requires_grad) |
|
void | checkAliasAnnotation (const std::shared_ptr< Graph > &graph, std::vector< IValue > pythonInputs, const std::string &unqualifiedOpName) |
|
void | vulkanInsertPrePackedOps (std::shared_ptr< Graph > &graph) |
|
void | vulkanInsertPrePackedOps (script::Module &module) |
|
void | vulkanFusePrePackedConvWithClamp (script::Module &module) |
|
void | vulkanFoldPrePackingOps (script::Module &m) |
|
script::Module | vulkanOptimizeForMobile (const script::Module &module, const std::vector< std::string > &preserved_methods) |
|
void | transformConv1dToConv2d (std::shared_ptr< Graph > &graph) |
|
void | transformConv1dToConv2d (script::Module &module) |
|
void | insertPrePackedOps (std::shared_ptr< Graph > &graph) |
|
void | insertPrePackedOps (script::Module &module) |
|
void | fusePrePackedLinearConvWithClamp (script::Module &module) |
|
void | FoldPrePackingOps (script::Module &m) |
|
script::Module | optimizeForMobile (const script::Module &module, const std::set< MobileOptimizerType > &blocklist, const std::vector< std::string > &preserved_methods) |
|
TORCH_API void | runJITCPPTests () |
|
void | initJITBindings (PyObject *module) |
|
c10::optional< Module > | as_module (const py::object &obj) |
|
static py::tuple | tuple_tail (const py::tuple &tup) |
|
void | clear_registered_instances (void *ptr) |
|
IValue | toIValue (py::handle obj, const TypePtr &type, c10::optional< int32_t > N) |
|
py::object | toPyObject (IValue ivalue) |
|
std::shared_ptr< CompilationUnit > | get_python_cu () |
|
TypedIValue | toDictKeyIValue (py::handle key) |
|
c10::optional< TypePtr > | unifyOrInitializeType (const TypePtr &accum, const TypePtr &unify) |
|
InferredType | tryToInferContainerType (py::handle input) |
|
InferredType | tryToInferType (py::handle input) |
|
bool | isTraceableType (const TypePtr &type) |
|
IValue | toTypeInferredIValue (py::handle input) |
|
Stack | toTraceableStack (const py::tuple &inputs) |
|
IValue | createGenericList (py::handle obj, const TypePtr &elem_type) |
|
IValue | createGenericDict (const py::dict &obj, const TypePtr &key_type, const TypePtr &value_type) |
|
template<class T > |
void | guardAgainstNamedTensor (const T &var) |
|
std::string | friendlyTypeName (py::handle obj) |
|
IValue | argumentToIValue (const FunctionSchema &schema, size_t argumentPosition, py::handle object) |
|
IValue | returnToIValue (const TypePtr &type, py::handle object) |
|
py::object | getScriptedClassOrError (const std::string &name) |
|
Stack | createStackForSchema (const FunctionSchema &schema, const tuple_slice &args, const py::kwargs &kwargs, c10::optional< IValue > self) |
|
py::object | createPyObjectForStack (Stack &&stack) |
|
Stack | evilDeprecatedBadCreateStackDoNotUse (const py::tuple &tuple, at::ArrayRef< Value * > inputs, size_t reserve_extra_space=0) |
|
py::object | runAndInsertCall (Function &callee, const tuple_slice &args, const py::kwargs &kwargs, c10::optional< IValue > self, const std::function< Value *(Graph &, const MatchedSchema &match)> &callInserter) |
|
py::object | invokeScriptFunctionFromPython (Function &callee, const tuple_slice &args, const py::kwargs &kwargs) |
|
py::object | invokeScriptMethodFromPython (Method &callee, const tuple_slice &args, const py::kwargs &kwargs) |
|
std::pair< std::shared_ptr< Operator >, Stack > | getOpWithStack (const std::vector< std::shared_ptr< Operator > > &operations, py::args args, const py::kwargs &kwargs) |
|
py::object | invokeOperatorFromPython (const std::vector< std::shared_ptr< Operator > > &operations, py::args args, const py::kwargs &kwargs) |
|
void | initPythonCustomClassBindings (PyObject *module) |
|
std::string | getPythonName (const PyObject *obj_) |
|
std::ostream & | printPyObject (std::ostream &out, const THPObjectPtr &obj) |
|
std::vector< Node * > | findAllNodes (c10::ArrayRef< torch::jit::Block * > blocks, Symbol kind, bool recurse=true) |
|
std::vector< Node * > | findAllNodes (Block *block, Symbol kind, bool recurse=true) |
|
Node * | findNode (c10::ArrayRef< torch::jit::Block * > blocks, Symbol kind, bool recurse=true) |
|
Node * | findNode (Block *block, Symbol kind, bool recurse=true) |
|
void | initPythonIRBindings (PyObject *module_) |
|
std::string | typeString (py::handle h) |
|
c10::optional< StrongFunctionPtr > | as_function (const py::object &obj) |
|
void | checkInterface (const SourceRange &loc, Function &m, const std::shared_ptr< ModuleValue > &self, const std::string &field) |
|
void | recurseThroughNestedModules (const SourceRange &loc, Function &m, std::vector< SugaredValuePtr > &keys, std::vector< SugaredValuePtr > &values, std::shared_ptr< ModuleValue > &self, const std::string &prefix, const std::string &field) |
|
std::shared_ptr< SugaredEnumClass > | createSugaredEnumClassFromObj (const py::object &obj, Function &m, const SourceRange &loc) |
|
std::shared_ptr< SugaredValue > | toSugaredValue (const IValue &v, Function &m, const SourceRange &loc) |
|
bool | isNamedTupleClass (const py::object &obj) |
|
TypePtr | registerNamedTuple (const py::object &obj, const SourceRange &loc) |
|
bool | isEnumClass (py::object obj) |
|
std::shared_ptr< SugaredValue > | createSimpleEnumValue (const py::object &obj, Function &m, const SourceRange &loc) |
|
std::shared_ptr< SugaredValue > | toSugaredValue (py::object obj, Function &m, const SourceRange &loc, bool is_constant) |
|
std::shared_ptr< SugaredValue > | toSimple (Value *v) |
|
c10::optional< std::string > | maybeConvertToString (const py::object &obj) |
|
template<typename T > |
List< T > | wrap_list (const SourceRange &fallback_pos, std::vector< T > &&vec) |
|
template<typename T > |
Maybe< T > | wrap_maybe (const SourceRange &fallback_pos, T *val) |
|
void | initTreeViewBindings (PyObject *module) |
|
bool | checkMutableFunctionDefault (const py::object &def_arg) |
|
void | checkMutableFunctionDefault (const SourceRange &range, const Argument &arg, const py::object &def_arg) |
|
FunctionSchema | getSchemaWithNameAndDefaults (const SourceRange &range, const FunctionSchema &schema, const at::optional< std::string > &new_name, const FunctionDefaults &default_args) |
|
static Decl | mergeDefaultsAndExtraParametersToOverloadDecl (const Decl &overload_decl, const Decl &impl_decl, const FunctionDefaults &defaults) |
|
static StrongFunctionPtr | script_compile_overloaded_function (const c10::QualifiedName &name, const Decl &overload_decl, const Def &implementation_def, const ResolutionCallback &rcb, const FunctionDefaults &implementation_defaults, const py::object &signature) |
|
static StrongFunctionPtr | script_compile_function (const c10::QualifiedName &name, const Def &def, const FunctionDefaults &defaults, const ResolutionCallback &rcb) |
|
static TypePtr | getTensorType (const at::Tensor &t, bool complete) |
|
static TupleTypePtr | getTupleTensorType (const Stack::const_iterator &s_iter, const Stack::const_iterator &s_iter_end, const TypePtr &tupleType, bool complete) |
|
static void | setInputTensorTypes (Graph &g, const Stack &stack, bool complete) |
|
static std::shared_ptr< Graph > | _propagate_shapes (Graph &graph, std::vector< at::Tensor > inputs, bool with_grad=false) |
|
static std::shared_ptr< Graph > | _propagate_and_assign_input_shapes (Graph &graph, const std::vector< at::Tensor > &inputs, bool with_grad=false, bool propagate=true) |
|
void | addFunctionToModule (Module &module, const StrongFunctionPtr &func) |
|
bool | ivalue_tags_match (const Module &lhs, const Module &rhs) |
|
template<typename T > |
py::list | debugMakeList (const T &list) |
|
template<typename T > |
py::list | debugMakeNamedList (const T &list) |
|
template<typename T > |
py::set | debugMakeSet (const T &list) |
|
static py::dict | _jit_debug_module_iterators (Module &module) |
|
IValue | pyIValueDeepcopy (const IValue &ivalue, const py::dict &memo) |
|
ExtraFilesMap | extra_files_from_python (const py::dict &pydict) |
|
void | extra_files_to_python (const ExtraFilesMap &m, const py::dict &pydict) |
|
void | pyCompilationUnitDefine (CompilationUnit &cu, const std::string &src, const ResolutionCallback *rcb, const uint32_t _frames_up) |
|
void | initJitScriptBindings (PyObject *module) |
|
void | setGraphExecutorOptimize (bool o) |
|
bool | getGraphExecutorOptimize () |
|
static void | scanWrittenSlots (Block *block, ArgumentSpecCreator::WrittenSlots &written_slots) |
|
static at::Device | ConvertIntToCPUOrCUDA (int device) |
|
std::ostream & | operator<< (std::ostream &out, const ArgumentInfo &info) |
|
std::ostream & | operator<< (std::ostream &out, const ArgumentSpec &spec) |
|
std::ostream & | operator<< (std::ostream &out, const CompleteArgumentInfo &info) |
|
std::ostream & | operator<< (std::ostream &out, const CompleteArgumentSpec &spec) |
|
c10::optional< int8_t > | convertOptional (c10::optional< c10::ScalarType > const &from) |
|
void | wrapDim (int64_t &dim, const std::vector< int64_t > &sizes) |
|
bool | needTrimGrad (Node *n) |
|
bool | isDifferentiable (const Node *n) |
|
bool | isDifferentiable (Graph &g) |
|
static c10::optional< std::vector< Value * > > | build_script_grad (Node *node, const ArrayRef< Value * > &grads) |
|
static std::vector< Value * > | linearGradientForNode (Node *node, ArrayRef< Value * > grad_values) |
|
static Value * | createAutogradAdd (Value *a, Value *b) |
|
static ReverseDetails | addReverseInline (Gradient &grad_desc) |
|
static value_list | getReverseCaptures (Gradient &grad_desc) |
|
static void | liftConstants (Block *block, Block *move_to_this_block) |
|
static bool | inBlock (Node *node, Block *container) |
|
static void | liftConstants (Node *node, Block *move_to_this_block) |
|
static void | foldSizeIfNotEqual (Block *node) |
|
static void | foldSizeIfNotEqual (Node *node) |
|
static void | deduplicateSizeCaptures (Gradient &grad_desc, ReverseDetails &rev_info) |
|
static void | eliminateDeadCode (ReverseDetails &rev_info) |
|
static void | Optimize (Gradient &grad_desc, ReverseDetails &rev_info) |
|
static void | lambdaLiftReverse (Gradient &grad_desc, ReverseDetails &rev_info) |
|
void | packReturnValuesIntoTuple (const std::shared_ptr< Graph > &graph) |
|
Gradient | differentiate (std::shared_ptr< Graph > &graph) |
|
TORCH_API bool | isZero (Value *v) |
|
std::ostream & | operator<< (std::ostream &out, const ExceptionMessage &msg) |
|
void | debugSetAutodiffSubgraphInlining (bool state) |
|
bool | getAutodiffSubgraphInlining () |
|
static std::atomic< bool > | fusion_group_inlining (true) |
|
void | debugSetFusionGroupInlining (bool state) |
|
bool | getFusionGroupInlining () |
|
std::shared_ptr< Graph > | lastExecutedOptimizedGraph () |
|
TORCH_API bool | IsNewExecutorEnabled () |
|
void | runRequiredPasses (const std::shared_ptr< Graph > &g) |
|
void | packGradient (const Gradient &gradient, Node *dnode) |
|
static bool | mayIntroduceGradient (const Block *b) |
|
bool | needsGradient (const std::shared_ptr< const Graph > &graph) |
|
void | runNondiffOptimization (std::shared_ptr< Graph > &graph, bool strict_fuser_check) |
|
void | runOptimization (std::shared_ptr< Graph > &graph, bool unroll, bool const_prop_user_classes) |
|
Node * | replaceBlockWithFallbackGraph (Block *b, ArrayRef< Value * > inputs) |
|
TORCH_API std::atomic< bool > & | getProfilingMode () |
|
TORCH_API std::atomic< bool > & | getExecutorMode () |
|
TORCH_API std::atomic< size_t > & | getNumProfiledRuns () |
|
TORCH_API std::atomic< size_t > & | getBailoutDepth () |
|
std::ostream & | operator<< (std::ostream &out, OpCode op) |
|
const char * | OpInfo (OpCode op) |
|
bool | isOpSupportedInMobile (OpCode op) |
|
TensorTypePtr | tensorTypeInCurrentExecutionContext (const at::Tensor &t) |
|
template<class Ttarget , class Tsource > |
Ttarget | safe_narrow_cast (Tsource v) |
|
std::vector< StackEntry > | currentCallstack () |
|
std::ostream & | operator<< (std::ostream &out, const Code &code) |
|
bool | aliasAnalysisHasSpecialCaseFor (Symbol symbol) |
|
void | registerOperator (Operator &&op) |
|
void | deregisterOperator (const FunctionSchema &schema) |
|
const std::vector< std::shared_ptr< Operator > > | getAllOperators () |
|
const std::vector< std::shared_ptr< Operator > > & | getAllOperatorsFor (Symbol name) |
|
std::shared_ptr< Operator > | findOperatorFor (const c10::OperatorName &full_name) |
|
std::vector< Symbol > | findSimilarOperators (Symbol input_op) |
|
std::shared_ptr< Operator > | getOperatorForLiteral (const char *signature) |
|
std::string | canonicalSchemaString (const FunctionSchema &schema) |
|
TORCH_API void | ensure_c10_registerer_defined () |
|
template<typename Func > |
c10::optional< Operator > | OperatorGenerator (torch::detail::SelectiveStr< true > schema_str, Func &&op, AliasAnalysisKind alias_analysis) |
|
template<typename Func > |
c10::optional< Operator > | OperatorGenerator (torch::detail::SelectiveStr< false > schema_str, Func &&op, AliasAnalysisKind alias_analysis) |
|
std::atomic< PrintHandler > | print_handler ([](const std::string &str) { std::cout<< str;}) |
|
PrintHandler | getPrintHandler () |
|
void | setPrintHandler (PrintHandler ph) |
|
static bool | needsGradientInProfilingMode (Block *b) |
|
bool | guardDifferentiableGraph (Node *dnode) |
|
void | runNooptPassPipeline (std::shared_ptr< Graph > &graph) |
|
void | runPreAutodiffPassPipeline (std::shared_ptr< Graph > &graph) |
|
void | runDiffGraphPasses (std::shared_ptr< Graph > &graph) |
|
void | runNoGradOptimizations (std::shared_ptr< Graph > &graph) |
|
Node * | insertFallbackFunctionCall (Graph *graph, Function *func, ArrayRef< Value * > inputs) |
|
Function * | createFallbackPathFunction (Block *b, const std::string &function_name) |
|
void | RegisterProfilingNode (const std::function< bool(const Node *)> &func) |
|
static void | unprofileGraphInputs (const std::shared_ptr< Graph > &graph) |
|
static void | unprofileBlock (Block *start_block) |
|
bool | needsProfiledInputs (Node *n) |
|
bool | needsProfiledOutput (Node *n) |
|
template<> |
c10::impl::GenericList | make_result_list< IValue > (const TypePtr &elemType) |
|
template<> |
void | listIndex< at::Tensor > (Stack *stack) |
|
template<> |
void | listCount< at::Tensor > (Stack *stack) |
|
template<> |
void | listEq< at::Tensor > (Stack *stack) |
|
template<> |
void | listNe< at::Tensor > (Stack *stack) |
|
template<> |
void | listSort< at::Tensor > (Stack *stack) |
|
template<> |
void | listCopyAndSort< at::Tensor > (Stack *stack) |
|
template<> |
void | listRemove< at::Tensor > (Stack *stack) |
|
void | checkImplicitTensorToNum (const at::Tensor &t, bool toInt) |
|
IValue | tensorToListRecursive (char *data, int64_t cur_dim, int64_t num_tensor_dims, TypePtr ty, at::ScalarType scalar_ty, at::IntArrayRef sizes, at::IntArrayRef strides, size_t element_size) |
|
void | checkDoubleInRange (double a) |
|
int64_t | partProduct (int n, int m) |
|
void | loop (int n, int64_t &p, int64_t &r) |
|
int | nminussumofbits (int v) |
|
int64_t | factorial (int n) |
|
double | degrees (double x) |
|
double | radians (double x) |
|
int64_t | normalizeIndex (int64_t idx, int64_t list_size) |
|
void | listAppend (Stack *stack) |
|
void | listReverse (Stack *stack) |
|
void | listPopImpl (Stack *stack, const char *empty_message) |
|
void | listPop (Stack *stack) |
|
void | listClear (Stack *stack) |
|
void | listDelete (Stack *stack) |
|
void | listInsert (Stack *stack) |
|
void | listExtend (Stack *stack) |
|
void | listCopy (Stack *stack) |
|
void | listSelect (Stack *stack) |
|
void | listLen (Stack *stack) |
|
void | listList (Stack *stack) |
|
void | listAdd (Stack *stack) |
|
void | listInplaceAdd (Stack *stack) |
|
void | listMulIntLeftInPlace (Stack *stack) |
|
void | listMulIntLeft (Stack *stack) |
|
void | listMulIntRight (Stack *stack) |
|
void | listSlice (Stack *stack) |
|
void | listSetItem (Stack *stack) |
|
c10::AliasAnalysisKind | aliasAnalysisFromSchema () |
|
c10::AliasAnalysisKind | aliasAnalysisConservative () |
|
c10::AliasAnalysisKind | aliasAnalysisSpecialCase () |
|
template<class T > |
c10::List< T > | make_result_list (const TypePtr &elemType) |
|
void | noop (Stack *n) |
|
double | round_to_even (double a) |
|
static int64_t | floordiv (int64_t a, int64_t b) |
|
static int64_t | floor (double a) |
|
static int64_t | ceil (double a) |
|
static int64_t | gcd (int64_t a, int64_t b) |
|
static at::Tensor | to_dispatch (at::Tensor self, c10::optional< at::Device > device, c10::optional< at::ScalarType > scalarType, bool non_blocking, bool copy) |
|
template<typename T > |
T | getItem (const c10::List< T > &list, int64_t idx) |
|
template<typename T > |
void | setItem (const c10::List< T > &list, int64_t idx, T &&value) |
|
template<typename T > |
void | minList (Stack *stack) |
|
template<typename T > |
void | maxList (Stack *stack) |
|
template<typename T > |
void | listRemove (Stack *stack) |
|
template<typename T > |
void | listMin (Stack *stack) |
|
template<typename T > |
void | listMax (Stack *stack) |
|
template<typename T > |
void | listIndex (Stack *stack) |
|
template<typename T > |
void | listCount (Stack *stack) |
|
template<typename T > |
void | listEq (Stack *stack) |
|
template<typename T > |
void | listNe (Stack *stack) |
|
bool | tensor_list_equal (const c10::List< at::Tensor > &a, const c10::List< at::Tensor > &b) |
|
template<typename T > |
void | listContains (Stack *stack) |
|
template<typename T > |
void | listSort (Stack *stack) |
|
template<typename T > |
void | listCopyAndSort (Stack *stack) |
|
int64_t | slice_indices_adjust (int64_t length, int64_t *start, int64_t *stop, int64_t step) |
|
void | createFusionGroups (Block *block, AliasDb *aliasDb) |
|
void | fuseStaticSubgraphs (std::shared_ptr< Graph > graph) |
|
Operation | createStaticSubgraphRuntime (const Node *node) |
|
bool | canHandle (Node *node) |
|
bool | canMerge (Node *consumer, Node *producer, AliasDb *aliasDb) |
|
Node * | getOrCreateStaticSubgraph (Node *n, AliasDb *aliasDb) |
|
value_list | sortReverseTopological (ArrayRef< Value * > inputs, Block *b) |
|
static void | debugDumpFusionGroup (const std::string &msg, Node *n) |
|
c10::optional< Node * > | tryMerge (Node *fusion_group, Node *to_merge, AliasDb *aliasDb) |
|
std::pair< graph_node_list::iterator, bool > | createFusionGroup (Node *fusion_node, AliasDb *aliasDb) |
|
std::pair< graph_node_list::iterator, bool > | scanNode (Node *n, AliasDb *aliasDb) |
|
void | PrepareGraphForStaticRuntime (std::shared_ptr< torch::jit::Graph > graph) |
|
TORCH_API std::shared_ptr< InferenceModule > | PrepareForStaticRuntime (const torch::jit::Module &m, InferenceModuleOptions opts=InferenceModuleOptions()) |
|
TORCH_API std::shared_ptr< InferenceModule > | PrepareForStaticRuntime (std::shared_ptr< torch::jit::Graph > g, InferenceModuleOptions opts=InferenceModuleOptions()) |
|
void | initStaticRuntimeBindings (PyObject *module) |
|
| C10_DEFINE_REGISTRY (SROperatorRegistry, SROperatorFunctor) |
|
| C10_DEFINE_REGISTRY (SRViewOperatorRegistry, SROperatorFunctor) |
|
bool | canRunOutOfPlace (Node *n) |
|
bool | canReuseInputsOutputs (Node *n) |
|
bool | isViewOp (Node *n) |
|
bool | canReuseInputs (Node *n) |
|
bool | canReuseOutputs (Node *n) |
|
bool | canRunNatively (Node *n) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::add, aten_add, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();auto &in1_t=p_node->Input(1).toTensor();auto in2_s=p_node->Input(2).toScalar();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::cpu::add_out(out_t, in0_t, in1_t, in2_s);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::mul, aten_mul, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();auto &in1_t=p_node->Input(1).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::mul_out(out_t, in0_t, in1_t);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::addmm, aten_addmm, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();auto &in1_t=p_node->Input(1).toTensor();auto &in2_t=p_node->Input(2).toTensor();auto in3_s=p_node->Input(3).toScalar();auto in4_s=p_node->Input(4).toScalar();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::addmm_cpu_out(out_t, in0_t, in1_t, in2_t, in3_s, in4_s);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::clamp, aten_clamp, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();auto in1_s=p_node->Input(1).toScalar();auto in2_s=p_node->Input(2).toScalar();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::clamp_out(out_t, in0_t, in1_s, in2_s);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::bmm, aten_bmm, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();auto &in1_t=p_node->Input(1).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::bmm_out_cpu(out_t, in0_t, in1_t);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::nan_to_num, aten_nan_to_num, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto input_size=p_node->inputs().size();auto &in0_t=p_node->Input(0).toTensor();double in1_d=input_size > 1 ? p_node->Input(1).toDouble() :0;double in2_d=input_size > 2 ? p_node->Input(2).toDouble() :std::numeric_limits< double >::infinity();double in3_d=input_size > 3 ? p_node->Input(3).toDouble() :-std::numeric_limits< double >::infinity();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::nan_to_num_out(out_t, in0_t, in1_d, in2_d, in3_d);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::cat, aten_cat, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto in0_tl=p_node->Input(0).toTensorVector();auto in1_i=p_node->Input(1).toInt();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_tl[0]);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::_cat_out_cpu(out_t, in0_tl, in1_i);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::tanh, aten_tanh, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::tanh_out(out_t, in0_t);};}) |
|
SROperator | aten_stack (Node *n) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::stack, aten_stack, aten_stack) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::sigmoid, aten_sigmoid, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::sigmoid_out(out_t, in0_t);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::leaky_relu, aten_leaky_relu, [](Node *n) -> SROperator { auto in1=toIValue(n->inputs()[1]);if(in1) { auto in1_s=in1->toScalar();return[=](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();at::native::leaky_relu_out(out_t, in0_t, in1_s);};} else { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();auto in1_s=p_node->Input(1).toScalar();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();at::native::leaky_relu_out(out_t, in0_t, in1_s);};} }) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::relu, aten_relu, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::threshold_out(out_t, in0_t, 0, 0);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::logit, aten_logit, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();double in1_d=p_node->inputs().size() > 1 ? p_node->Input(1).toDouble() :-1.0;if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);at::native::logit_out(out_t, in0_t, in1_d);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::clone, aten_clone, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &in0_t=p_node->Input(0).toTensor();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(in0_t);} auto &out_t=p_node->Output(0).toTensor();at::native::resize_as_(out_t, in0_t, c10::nullopt);at::native::copy_(out_t, in0_t, false);};}) |
|
| REGISTER_OPERATOR_FUNCTOR_OPT (quantized::embedding_bag_byte_rowwise_offsets, quantized_embedding_bag_byte_rowwise_offsets, false, true, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &weight=p_node->Input(0).toTensor();auto &indices=p_node->Input(1).toTensor();auto offsets=p_node->Input(2).toOptional< at::Tensor >();auto pruned_weights=p_node->Input(5).toBool();auto per_sample_weights=p_node->Input(6).toOptional< at::Tensor >();auto compressed_indices_mapping=p_node->Input(7).toOptional< at::Tensor >();auto include_last_offset=p_node->Input(8).toBool();if(p_node->Output(0).isNone()) { p_node->Output(0)=at::empty({0}, weight.options().dtype(at::kFloat));} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);return at::native::embedding_bag_byte_rowwise_offsets_out(out_t, weight, indices, offsets, false, 0, pruned_weights, per_sample_weights, compressed_indices_mapping, include_last_offset);};}) |
|
| REGISTER_OPERATOR_FUNCTOR_OPT (quantized::embedding_bag_4bit_rowwise_offsets, embedding_bag_4bit_rowwise_offsets, false, true, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &weight=p_node->Input(0).toTensor();auto &indices=p_node->Input(1).toTensor();auto offsets=p_node->Input(2).toOptional< at::Tensor >();auto pruned_weights=p_node->Input(5).toBool();auto per_sample_weights=p_node->Input(6).toOptional< at::Tensor >();auto compressed_indices_mapping=p_node->Input(7).toOptional< at::Tensor >();auto include_last_offset=p_node->Input(8).toBool();if(p_node->Output(0).isNone()) { p_node->Output(0)=at::empty({0}, weight.options().dtype(at::kFloat));} auto &out_t=p_node->Output(0).toTensor();fastResizeToZero(out_t);return at::native::embedding_bag_byte_rowwise_offsets_out(out_t, weight, indices, offsets, false, 0, pruned_weights, per_sample_weights, compressed_indices_mapping, include_last_offset);};}) |
|
| REGISTER_OPERATOR_FUNCTOR (aten::narrow, aten_narrow, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &self=p_node->Input(0).toTensor();auto dim=p_node->Input(1).toInt();int64_t start=0;if(p_node->Input(2).isScalar()) { start=p_node->Input(2).toInt();} else { auto &t=p_node->Input(2).toTensor();start=t.item< int64_t >();} auto length=p_node->Input(3).toInt();if(p_node->Output(0).isNone()) { p_node->Output(0)=create_empty_from(self);} auto &output=p_node->Output(0).toTensor();fastResizeToZero(output);at::native::narrow_copy_dense_cpu_out(self, dim, start, length, output);};}) |
|
| REGISTER_VIEW_OPERATOR_FUNCTOR (aten::reshape, aten_reshape, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { auto &self=p_node->Input(0).toTensor();auto proposed_shape=p_node->Input(1).toIntVector();if(p_node->Output(0).isNone()) { p_node->Output(0)=at::Tensor();} auto &out=p_node->Output(0).toTensor();at::native::reshape_out(out, self, proposed_shape, true);};}) |
|
| REGISTER_VIEW_OPERATOR_FUNCTOR (aten::flatten, aten_flatten, [](Node *n) -> SROperator { return[](ProcessedNode *p_node) { DCHECK(p_node->inputs().size()==3);auto &self=p_node->Input(0).toTensor();auto start_dim=p_node->Input(1).toInt();auto end_dim=p_node->Input(2).toInt();if(p_node->Output(0).isNone()) { p_node->Output(0)=at::Tensor();} auto &out=p_node->Output(0).toTensor();at::native::flatten_out(out, self, start_dim, end_dim);};}) |
|
std::function< void(ProcessedNode *)> | getOutOfPlaceOperation (Node *n) |
|
std::function< void(ProcessedNode *)> | getNativeOperation (Node *n) |
|
| C10_DECLARE_REGISTRY (SROperatorRegistry, SROperatorFunctor) |
|
| C10_DECLARE_REGISTRY (SRViewOperatorRegistry, SROperatorFunctor) |
|
at::Tensor | create_empty_from (const at::Tensor &t) |
|
bool | checkResizedDataPtr (at::Tensor &t) |
|
void | fastResizeToZero (at::Tensor &t) |
|
void | ConcatAddMulReplaceNaNClip (std::shared_ptr< torch::jit::Graph > &graph) |
|
void | CastedBatchOneHotLengths (std::shared_ptr< torch::jit::Graph > &graph) |
|
void | ConcatBatchMatMulBatchGather (std::shared_ptr< torch::jit::Graph > &graph) |
|
void | ClipRangesGatherRangesLengthsToOffsets (std::shared_ptr< torch::jit::Graph > &graph) |
|
void | ClipRangesGatherSigridHash (std::shared_ptr< torch::jit::Graph > &graph) |
|
void | ClipRangesGatherRangesSigridHash (std::shared_ptr< torch::jit::Graph > &graph) |
|
void | FuseInferenceOpsForSparseNN (std::shared_ptr< torch::jit::Graph > &graph) |
|
std::pair< std::shared_ptr< Graph >, Value * > | extractClosure (Value *closure) |
|
Argument | originalReturnType (const TupleTypePtr &tup) |
|
std::string | overloadedSchemaString (const FunctionSchema &schema) |
|
bool | isHelperFunction (const std::string &method_name) |
|
void | loadModule (const CompilationUnit &module) |
|
void | loadFunctions () |
|
c10::optional< GradientPair > | gradientInfoForSchema (const FunctionSchema &schema) |
|
bool | hasGradientInfoForSchema (const FunctionSchema &schema) |
|
void | tupleUnpack (Stack &stack) |
|
void | format (Stack &stack, size_t num_inputs) |
|
void | percentFormat (Stack &stack, size_t num_inputs) |
|
void | listUnpack (Stack &stack, size_t num_outputs) |
|
void | tupleConstruct (Stack &stack, size_t num_inputs) |
|
void | namedTupleConstruct (Stack &stack, at::TupleTypePtr type, size_t num_inputs) |
|
void | listConstruct (Stack &stack, const at::ListType &type, size_t num_inputs) |
|
void | dictConstruct (Stack &stack, const at::DictTypePtr &type, size_t num_inputs) |
|
void | createObject (Stack &stack, const at::ClassTypePtr &type) |
|
void | isinstance (Stack &stack, at::ArrayRef< at::TypePtr > types) |
|
void | tupleSlice (Stack &stack, size_t begin, size_t end) |
|
void | dequantize (Stack &stack) |
|
void | writeArchiveAndTensors (const std::string &archive_name, const char *data, size_t size, const std::vector< at::Tensor > &tensors, caffe2::serialize::PyTorchStreamWriter &out) |
|
std::string | pretty_print_onnx (const std::shared_ptr< Graph > &graph, const std::map< std::string, at::Tensor > &initializers, int64_t onnx_opset_version, bool defer_weight_export, ::torch::onnx::OperatorExportTypes operator_export_type, bool google_printer, bool keep_initializers_as_inputs, const std::map< std::string, int > &custom_opsets, bool add_node_names) |
|
std::tuple< std::shared_ptr<::ONNX_NAMESPACE::ModelProto >, RawDataExportMap, SymbolDimMap > | export_onnx (const std::shared_ptr< Graph > &graph, const std::map< std::string, at::Tensor > &initializers, int64_t onnx_opset_version, const std::unordered_map< std::string, std::unordered_map< std::int64_t, std::string > > &dynamic_axes, bool defer_weight_export, ::torch::onnx::OperatorExportTypes operator_export_type, bool strip_doc_string, bool keep_initializers_as_inputs, const std::map< std::string, int > &custom_opsets, bool add_node_names, bool use_external_data_format, const std::string &onnx_file_path) |
|
std::string | serialize_model_proto_to_string (const std::shared_ptr<::ONNX_NAMESPACE::ModelProto > &model_proto) |
|
void | check_onnx_proto (const std::string &proto_string) |
|
TORCH_API std::tuple< std::shared_ptr<::ONNX_NAMESPACE::ModelProto >, RawDataExportMap, SymbolDimMap > | export_onnx (const std::shared_ptr< Graph > &graph, const std::map< std::string, at::Tensor > &initializers, int64_t onnx_opset_version, const std::unordered_map< std::string, std::unordered_map< int64_t, std::string > > &dynamic_axes, bool defer_weight_export=false, ::torch::onnx::OperatorExportTypes operator_export_type=::torch::onnx::OperatorExportTypes::ONNX, bool strip_doc_string=true, bool keep_initializers_as_inputs=true, const std::map< std::string, int > &custom_opsets={}, bool add_node_names=true, bool use_external_data_format=false, const std::string &onnx_file_path=std::string()) |
|
TORCH_API void | ExportModule (const Module &module, std::ostream &out, const ExtraFilesMap &metadata=ExtraFilesMap(), bool bytecode_format=false, bool save_mobile_debug_info=false) |
|
TORCH_API void | ExportModule (const Module &module, const std::string &filename, const ExtraFilesMap &metadata=ExtraFilesMap(), bool bytecode_format=false, bool save_mobile_debug_info=false) |
|
TORCH_API void | ExportModule (const Module &module, const std::function< size_t(const void *, size_t)> &writer_func, const ExtraFilesMap &metadata=ExtraFilesMap(), bool bytecode_format=false, bool save_mobile_debug_info=false) |
|
TORCH_API void | SetExportModuleExtraFilesHook (ExportModuleExtraFilesHook hook) |
|
TORCH_API void | SetExportModuleMobileInfoConverter (ExportModuleMobileInfoConverter converter) |
|
TORCH_API std::vector< std::string > | export_opnames (const Module &m) |
|
void | moduleMethodsTuple (const Module &module, std::vector< c10::IValue > &elements, c10::optional< std::vector< c10::IValue > > &debug_info_elements, bool save_mobile_debug_info) |
|
void | postSetStateValidate (const IValue &v) |
|
IValue | readArchiveAndTensors (const std::string &archive_name, c10::optional< TypeResolver > type_resolver, c10::optional< ObjLoader > obj_loader, c10::optional< at::Device > device, PyTorchStreamReader &stream_reader) |
|
Module | import_ir_module (std::shared_ptr< CompilationUnit > cu, std::istream &in, c10::optional< at::Device > device) |
|
Module | import_ir_module (std::shared_ptr< CompilationUnit > cu, std::istream &in, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
Module | import_ir_module (std::shared_ptr< CompilationUnit > cu, const std::string &filename, c10::optional< at::Device > device) |
|
Module | import_ir_module (std::shared_ptr< CompilationUnit > cu, const std::string &filename, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
Module | import_ir_module (std::shared_ptr< CompilationUnit > cu, std::unique_ptr< ReadAdapterInterface > rai, c10::optional< at::Device > device) |
|
Module | import_ir_module (std::shared_ptr< CompilationUnit > cu, std::unique_ptr< ReadAdapterInterface > rai, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
Module | load (std::istream &in, c10::optional< c10::Device > device=c10::nullopt) |
| Loads a serialized Module from the given istream . More...
|
|
Module | load (std::istream &in, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
Module | load (const std::string &filename, c10::optional< c10::Device > device=c10::nullopt) |
| Loads a serialized Module from the given filename . More...
|
|
Module | load (const std::string &filename, c10::optional< at::Device > device, ExtraFilesMap &extra_files) |
|
Module | load (std::shared_ptr< caffe2::serialize::ReadAdapterInterface > rai, c10::optional< c10::Device > device=c10::nullopt) |
| Loads a serialized Module from the given shared_ptr rai . More...
|
|
Module | load (std::shared_ptr< ReadAdapterInterface > rai, c10::optional< c10::Device > device, ExtraFilesMap &extra_files) |
|
void | moduleMethodsTuple (const Module &module, std::vector< c10::IValue > &elements) |
|
std::string | qualifierToArchivePath (const std::string &qualifier, const std::string &export_prefix) |
|
std::shared_ptr< Source > | findSourceInArchiveFromQualifier (caffe2::serialize::PyTorchStreamReader &reader, const std::string &export_prefix, const std::string &qualifier) |
|
Module | LEGACY_deserialize (std::shared_ptr< CompilationUnit > cu, std::shared_ptr< caffe2::serialize::PyTorchStreamReader > reader, const c10::optional< c10::Device > &device) |
|
std::string | prettyPrint (const ::ONNX_NAMESPACE::ModelProto &model) |
|
void | pickle (std::function< void(const char *data_start, size_t data_len)> writer, const IValue &ivalue, std::vector< at::Tensor > *tensor_table=nullptr) |
| Pickle an IValue by calling a function to handle writing the data. More...
|
|
std::vector< char > | pickle (const IValue &ivalue, std::vector< at::Tensor > *tensor_table=nullptr) |
| Save a torch::IValue in a format compatible with Python's pickle module. More...
|
|
std::vector< char > | pickle_save (const IValue &ivalue) |
| Save a torch::IValue in a format that can be loaded by both torch::pickle_load in C++ and torch.load in Python. More...
|
|
IValue | pickle_load (const std::vector< char > &data) |
| Deserialize a torch::IValue from bytes produced by either torch::pickle_save in C++ or torch.save in Python. More...
|
|
IValue | unpickle (std::function< size_t(char *, size_t)> reader, TypeResolver type_resolver, const std::vector< at::Tensor > *tensor_table) |
| reader is a function that takes in a size to read from some pickled binary. More...
|
|
IValue | unpickle (const char *data, size_t size, TypeResolver type_resolver=nullptr, const std::vector< at::Tensor > *tensor_table=nullptr) |
| Decode a chunk of memory containing pickled data into its torch::IValue s. More...
|
|
static double | swapDouble (double value) |
|
WriteableTensorData | getWriteableTensorData (const at::Tensor &tensor, bool to_cpu) |
|
bool | checkHasValidSetGetState (const std::shared_ptr< c10::ClassType > &cls) |
|
void | setTypeTags (bool state) |
|
bool | getTypeTags () |
|
uint64_t | getStorageKey (const at::Tensor &tensor) |
|
static bool | isValidIdentifierChar (char c, size_t pos) |
|
static bool | isValidIdentifier (const std::string &name) |
|
TORCH_API bool | printerHasSpecialCaseFor (c10::Symbol sym) |
|
static void | restoreAccurateTypeTagsIfPossible (const IValue &root) |
|
void | restoreAccurateTypeTags (const IValue &root, const TypePtr &type_tag) |
|
void | restoreContainerTypeTags (IValue &ivalue, const TypePtr &type) |
|
template<typename T > |
void | append (std::vector< T > &a, T &&e) |
|
template<> |
void | append< bool > (std::vector< bool > &a, bool &&e) |
|
static std::vector< int64_t > | tupleToIntList (const IValue &v) |
|
template<typename T > |
static std::vector< T > | convertList (const IValue &v) |
|
bool | is_valid_python_id_char (char c) |
|
void | initTensorExprBindings (PyObject *module) |
|
def | export_opnames (m) |
|
def | annotate (the_type, the_value) |
|
def | script_if_tracing (fn) |
|
def | isinstance (obj, target_type) |
|