Trace builder — TF2 tf.function analogue (tf.func in scripts). While active, TF ops record into this graph.
更多...
#include <Graph.h>
Public 成员函数 | |
| Func (TF *owner) | |
| Func. | |
| ~Func () | |
| Func. | |
| Tensor * | input1 (int d0) |
| Input 1. | |
| Tensor * | input2 (int d0, int d1) |
| Input 2. | |
| Tensor * | input3 (int d0, int d1, int d2) |
| Input 3. | |
| Tensor * | input4 (int d0, int d1, int d2, int d3) |
| Input 4. | |
| Tensor * | input5 (int d0, int d1, int d2, int d3, int d4) |
| Input 5. | |
| Tensor * | input6 (int d0, int d1, int d2, int d3, int d4, int d5) |
| Input 6. | |
| void | setOutput (Tensor *t) |
| Sets the output. | |
| class CompiledFunction * | compile () |
| Compiles compile. | |
| Graph & | graph () |
| Graph. | |
| const Graph & | graph () const |
| Graph. | |
| TF * | owner () const |
| Owner. | |
| bool | isTracing () const |
| True when tracing. | |
| int | outputNode () const |
| Output node. | |
| int | placeholderCount () const |
| Placeholder count. | |
| int | ensureNode (const Tensor *t) |
| Ensure tensor is a node in this graph (Const-capture if eager). | |
| Tensor * | emitUnary (OpType type, const Tensor *x) |
| Emit unary. | |
| Tensor * | emitUnaryScalar (OpType type, const Tensor *x, float s0, float s1=0.f) |
| Emit unary scalar. | |
| Tensor * | emitBinary (OpType type, const Tensor *a, const Tensor *b) |
| Emit binary. | |
| Tensor * | emitTernary (OpType type, const Tensor *a, const Tensor *b, const Tensor *c) |
| Emit ternary. | |
| Tensor * | emitMatMul (const Tensor *a, const Tensor *b) |
| Emit mat mul. | |
| Tensor * | emitTranspose (const Tensor *x) |
| Emit transpose. | |
| Tensor * | emitPermute (const Tensor *x, const int *order, int rank) |
| Emit permute. | |
| Tensor * | emitReshape (const Tensor *x, const int *dims, int rank) |
| Emit reshape. | |
| Tensor * | emitFill (const int *dims, int rank, float value) |
| Emit fill. | |
| Tensor * | emitSoftmax (const Tensor *x, int axis, bool logMode) |
| Emit softmax. | |
| Tensor * | emitLayerNorm (const Tensor *x, const Tensor *scale, const Tensor *bias, float eps) |
| Emit layer norm. | |
| Tensor * | emitRMSNorm (const Tensor *x, const Tensor *scale, float eps) |
| Emit rms norm. | |
| Tensor * | emitConv1d (const Tensor *x, const Tensor *w, const Tensor *bias, int stride, int pad) |
| Emit conv 1 d. | |
| Tensor * | emitConv2d (const Tensor *x, const Tensor *w, const Tensor *bias, int stride, int pad) |
| Emit conv 2 d. | |
| Tensor * | emitPool (OpType type, const Tensor *x, int ksize, int stride, int pad) |
| Emit pool. | |
| Tensor * | emitEmbedding (const Tensor *table, const Tensor *indices) |
| Emit embedding. | |
| Tensor * | emitConcat (const Tensor *const *ins, int n, int axis) |
| Emit concat. | |
| Tensor * | emitSlice (const Tensor *x, int axis, int begin, int end) |
| Emit slice. | |
| Tensor * | emitReduce (OpType type, const Tensor *x, int axis, bool keepDims) |
| Emit reduce. | |
| Tensor * | emitArgMax (const Tensor *x, int axis, bool keepDims) |
| Emit arg max. | |
| Tensor * | emitCast (const Tensor *x, DType dtype) |
| Emit cast. | |
| Tensor * | emitSdpa (const Tensor *q, const Tensor *k, const Tensor *v, const Tensor *mask, float scale) |
| Emit sdpa. | |
| Tensor * | emitResize2d (const Tensor *x, int outH, int outW, int mode) |
| Emit resize 2 d. | |
详细描述
Trace builder — TF2 tf.function analogue (tf.func in scripts). While active, TF ops record into this graph.
构造及析构函数说明
◆ Func()
|
explicit |
◆ ~Func()
| eve::tensor::Func::~Func | ( | ) |
成员函数说明
◆ compile()
| CompiledFunction * eve::tensor::Func::compile | ( | ) |
Compiles compile.
引用了 eve::tensor::CompiledFunction::fromFunc() , 以及 eve::tensor::TF::popTrace().
◆ emitArgMax()
◆ emitBinary()
Emit binary.
引用了 a, eve::tensor::Graph::addNode(), b, eve::tensor::kernels::broadcastShape(), ensureNode(), eve::tensor::Tensor::kMaxRank, n, eve::tensor::Graph::node() , 以及 type.
◆ emitCast()
◆ emitConcat()
◆ emitConv1d()
| Tensor * eve::tensor::Func::emitConv1d | ( | const Tensor * | x, |
| const Tensor * | w, | ||
| const Tensor * | bias, | ||
| int | stride, | ||
| int | pad | ||
| ) |
Emit conv 1 d.
引用了 eve::tensor::Graph::addNode(), bias, eve::tensor::Conv1d, ensureNode(), n, eve::tensor::Graph::node(), nx, pad, w , 以及 x.
◆ emitConv2d()
| Tensor * eve::tensor::Func::emitConv2d | ( | const Tensor * | x, |
| const Tensor * | w, | ||
| const Tensor * | bias, | ||
| int | stride, | ||
| int | pad | ||
| ) |
Emit conv 2 d.
引用了 eve::tensor::Graph::addNode(), bias, eve::tensor::Conv2d, ensureNode(), n, eve::tensor::Graph::node(), nx, pad, w , 以及 x.
◆ emitEmbedding()
Emit embedding.
引用了 eve::tensor::Graph::addNode(), eve::tensor::Embedding, ensureNode(), indices, eve::tensor::Tensor::kMaxRank, n , 以及 eve::tensor::Graph::node().
◆ emitFill()
| Tensor * eve::tensor::Func::emitFill | ( | const int * | dims, |
| int | rank, | ||
| float | value | ||
| ) |
Emit fill.
引用了 eve::tensor::Graph::addNode(), eve::tensor::Const, n , 以及 value.
◆ emitLayerNorm()
| Tensor * eve::tensor::Func::emitLayerNorm | ( | const Tensor * | x, |
| const Tensor * | scale, | ||
| const Tensor * | bias, | ||
| float | eps | ||
| ) |
Emit layer norm.
引用了 eve::tensor::Graph::addNode(), bias, cols, eve::tensor::GraphNode::dims, ensureNode(), eve::tensor::LayerNorm, n, eve::tensor::Graph::node(), eve::tensor::GraphNode::rank, scale , 以及 x.
◆ emitMatMul()
Emit mat mul.
引用了 a, eve::tensor::Graph::addNode(), b, ensureNode(), eve::tensor::MatMul, n , 以及 eve::tensor::Graph::node().
◆ emitPermute()
Emit permute.
引用了 eve::tensor::Graph::addNode(), ensureNode(), eve::tensor::Tensor::kMaxRank, n, eve::tensor::Graph::node(), order, eve::tensor::Permute , 以及 x.
被这些函数引用 emitTranspose().
◆ emitPool()
| Tensor * eve::tensor::Func::emitPool | ( | OpType | type, |
| const Tensor * | x, | ||
| int | ksize, | ||
| int | stride, | ||
| int | pad | ||
| ) |
Emit pool.
引用了 eve::tensor::Graph::addNode(), eve::tensor::GraphNode::dims, ensureNode(), n, eve::tensor::Graph::node(), pad, eve::tensor::GraphNode::rank, type , 以及 x.
◆ emitReduce()
◆ emitReshape()
Emit reshape.
引用了 eve::tensor::Graph::addNode(), ensureNode(), n, eve::tensor::Graph::node(), eve::tensor::Graph::product(), eve::tensor::Reshape , 以及 x.
◆ emitResize2d()
Emit resize 2 d.
引用了 eve::tensor::Graph::addNode(), eve::tensor::GraphNode::dims, ensureNode(), n, eve::tensor::Graph::node(), eve::tensor::GraphNode::rank, eve::tensor::Resize2d , 以及 x.
◆ emitRMSNorm()
Emit rms norm.
引用了 eve::tensor::Graph::addNode(), cols, eve::tensor::GraphNode::dims, ensureNode(), n, eve::tensor::Graph::node(), eve::tensor::GraphNode::rank, eve::tensor::RMSNorm, scale , 以及 x.
◆ emitSdpa()
| Tensor * eve::tensor::Func::emitSdpa | ( | const Tensor * | q, |
| const Tensor * | k, | ||
| const Tensor * | v, | ||
| const Tensor * | mask, | ||
| float | scale | ||
| ) |
Emit sdpa.
引用了 eve::tensor::Graph::addNode(), ensureNode(), mask, n, eve::tensor::Graph::node(), q, scale, eve::tensor::ScaledDotProductAttention , 以及 v.
◆ emitSlice()
◆ emitSoftmax()
Emit softmax.
引用了 eve::tensor::Graph::addNode(), ensureNode(), eve::tensor::GraphNode::in0, eve::tensor::LogSoftmax, n, eve::tensor::Graph::node(), eve::tensor::Softmax , 以及 x.
◆ emitTernary()
| Tensor * eve::tensor::Func::emitTernary | ( | OpType | type, |
| const Tensor * | a, | ||
| const Tensor * | b, | ||
| const Tensor * | c | ||
| ) |
Emit ternary.
引用了 a, eve::tensor::Graph::addNode(), b, c, ensureNode(), n, eve::tensor::Graph::node() , 以及 type.
◆ emitTranspose()
Emit transpose.
引用了 emitPermute(), ensureNode(), eve::tensor::Graph::node(), order , 以及 x.
◆ emitUnary()
Emit unary.
引用了 eve::tensor::Graph::addNode(), ensureNode(), n, eve::tensor::Graph::node(), type , 以及 x.
◆ emitUnaryScalar()
| Tensor * eve::tensor::Func::emitUnaryScalar | ( | OpType | type, |
| const Tensor * | x, | ||
| float | s0, | ||
| float | s1 = 0.f |
||
| ) |
Emit unary scalar.
引用了 eve::tensor::Graph::addNode(), ensureNode(), n, eve::tensor::Graph::node(), type , 以及 x.
◆ ensureNode()
| int eve::tensor::Func::ensureNode | ( | const Tensor * | t | ) |
Ensure tensor is a node in this graph (Const-capture if eager).
引用了 eve::tensor::Graph::addNode(), eve::tensor::Const, n , 以及 t.
被这些函数引用 emitArgMax(), emitBinary(), emitCast(), emitConcat(), emitConv1d(), emitConv2d(), emitEmbedding(), emitLayerNorm(), emitMatMul(), emitPermute(), emitPool(), emitReduce(), emitReshape(), emitResize2d(), emitRMSNorm(), emitSdpa(), emitSlice(), emitSoftmax(), emitTernary(), emitTranspose(), emitUnary(), emitUnaryScalar() , 以及 setOutput().
◆ graph() [1/2]
◆ graph() [2/2]
◆ input1()
| Tensor * eve::tensor::Func::input1 | ( | int | d0 | ) |
Input 1.
引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.
◆ input2()
| Tensor * eve::tensor::Func::input2 | ( | int | d0, |
| int | d1 | ||
| ) |
Input 2.
引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.
◆ input3()
| Tensor * eve::tensor::Func::input3 | ( | int | d0, |
| int | d1, | ||
| int | d2 | ||
| ) |
Input 3.
引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.
◆ input4()
| Tensor * eve::tensor::Func::input4 | ( | int | d0, |
| int | d1, | ||
| int | d2, | ||
| int | d3 | ||
| ) |
Input 4.
引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.
◆ input5()
| Tensor * eve::tensor::Func::input5 | ( | int | d0, |
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| int | d4 | ||
| ) |
Input 5.
引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.
◆ input6()
| Tensor * eve::tensor::Func::input6 | ( | int | d0, |
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| int | d4, | ||
| int | d5 | ||
| ) |
Input 6.
引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.
◆ isTracing()
◆ outputNode()
◆ owner()
◆ placeholderCount()
◆ setOutput()
| void eve::tensor::Func::setOutput | ( | Tensor * | t | ) |
该类的文档由以下文件生成: