Function¶
-
class Function¶
An immutable compute graph produced by FunctionBuilder.
A function has named
inputsandoutputs, a list of intermediatelocals, namedglobalsfor trainable or externally supplied tensors, and the ordered list of InstructionCall that computes the outputs from the inputs. Run one with aFunctionRuntime, orsaveit to disk andloadit back.Public Functions
-
Function() = default¶
-
inline const NamedVector<Value> &inputs() const¶
Named graph inputs.
-
inline const NamedVector<Value> &outputs() const¶
Named graph outputs.
-
inline const ValueVec &locals() const¶
Intermediate values, one per instruction output.
-
inline const std::vector<std::pair<std::string, Value>> &globals() const¶
Named global tensors: trainable parameters and external inputs.
-
inline const std::vector<InstructionCall> &instructions() const¶
The instruction calls in execution order.
-
void save(const std::string &file) const¶
Serialize the function to
file.
Public Static Functions
Friends
- friend class FunctionBuilder
-
Function() = default¶