Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Friends
torch::jit::Graph Struct Reference

Public Member Functions

 TH_DISALLOW_COPY_AND_ASSIGN (Graph)
 
 Graph (ScopePtr scope_root)
 
at::ArrayRef< Value * > inputs ()
 
at::ArrayRef< const Value * > inputs () const
 
at::ArrayRef< Value * > outputs ()
 
at::ArrayRef< const Value * > outputs () const
 
graph_node_list nodes ()
 
const_graph_node_list nodes () const
 
Node * param_node ()
 
const Node * param_node () const
 
Node * return_node ()
 
const Node * return_node () const
 
const std::unordered_map< std::string, Value * > & uniqueNames () const
 
void push_scope (const std::string &scope_name)
 
void pop_scope ()
 
ScopePtr current_scope ()
 
void set_current_scope (ScopePtr scope)
 
Value * addInput (std::string name="")
 
Value * insertInput (size_t i, std::string name="")
 
void eraseInput (size_t i)
 
size_t registerOutput (Value *n)
 
void eraseOutput (size_t i)
 
TORCH_API Node * create (NodeKind kind, size_t num_outputs=1)
 
TORCH_API Node * create (NodeKind kind, ArrayRef< Value * > inputs, size_t num_outputs=1)
 
TORCH_API Node * createNone (TypePtr typ)
 
TORCH_API Node * createAutogradZero ()
 
TORCH_API Node * createFusionGroup ()
 
TORCH_API Node * createDifferentiableSubgraph ()
 
TORCH_API Node * createTuple (at::ArrayRef< Value * > values, c10::OptNameList field_names=c10::nullopt)
 
TORCH_API Node * createTupleUnpack (Value *v)
 
TORCH_API Node * createTupleIndex (Value *tup, int64_t index)
 
TORCH_API Node * createTupleSlice (Value *tup, int64_t beg, int64_t end)
 
TORCH_API Node * createList (const TypePtr &elem_type, at::ArrayRef< Value * > values)
 
TORCH_API Node * createListUnpack (Value *v, size_t size)
 
TORCH_API Node * createDict (const TypePtr &key_type, const TypePtr &value_type, at::ArrayRef< Value * > keys, at::ArrayRef< Value * > values)
 
TORCH_API Node * createDictIndex (Value *dict, Value *index)
 
TORCH_API Node * createNumToTensor (Value *value)
 
TORCH_API Node * createImplicitTensorToNum (const TypePtr &type, Value *value)
 
TORCH_API Node * createObject (const ClassTypePtr &type)
 
TORCH_API Node * createSetAttr (Value *obj, const std::string &field, Value *newValue)
 
TORCH_API Node * createGetAttr (Value *obj, const std::string &field)
 
Node * createPythonOp (THPObjectPtr &&pyobj, const std::string &cconv, pyobj_list &&scalar_args)
 
TORCH_API Node * createClone (Node *n, const std::function< Value *(Value *)> &value_map, bool copy_blocks=true)
 
TORCH_API Value * insertConstant (IValue val, const TypePtr &result_type=nullptr, c10::optional< SourceRange > loc=c10::nullopt, c10::optional< ScopePtr > scope=c10::nullopt)
 
TORCH_API Value * insert (Symbol opname, at::ArrayRef< NamedValue > args, at::ArrayRef< NamedValue > kwargs={}, const c10::optional< SourceRange > &range={})
 
Node * appendNode (Node *n)
 
Node * prependNode (Node *n)
 
Node * insertNode (Node *n)
 
void setInsertPoint (Block *b)
 
void setInsertPoint (Node *n)
 
Node * insertPoint ()
 
Block * block ()
 
const Block * block () const
 
TORCH_API void lint () const
 
TORCH_API void dump () const
 
TORCH_API std::string toString () const
 
TORCH_API std::ostream & prettyPrint (std::ostream &out)
 
TORCH_API void dumpPretty ()
 
TORCH_API std::shared_ptr< Graph > copy ()
 

Friends

struct Node
 
struct Value
 
struct Block
 
TORCH_API std::ostream & operator<< (std::ostream &out, const Graph &g)
 

Detailed Description

Definition at line 936 of file ir.h.


The documentation for this struct was generated from the following files: