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 () | |
| Tensor * | input1 (int d0) |
| Tensor * | input2 (int d0, int d1) |
| Tensor * | input3 (int d0, int d1, int d2) |
| Tensor * | input4 (int d0, int d1, int d2, int d3) |
| Tensor * | input5 (int d0, int d1, int d2, int d3, int d4) |
| Tensor * | input6 (int d0, int d1, int d2, int d3, int d4, int d5) |
| void | setOutput (Tensor *t) |
| class CompiledFunction * | compile () |
| Graph & | graph () |
| const Graph & | graph () const |
| TF * | owner () const |
| bool | isTracing () const |
| int | outputNode () const |
| int | placeholderCount () const |
| int | ensureNode (const Tensor *t) |
| Ensure tensor is a node in this graph (Const-capture if eager). | |
| Tensor * | emitUnary (OpType type, const Tensor *x) |
| Tensor * | emitUnaryScalar (OpType type, const Tensor *x, float s0, float s1=0.f) |
| Tensor * | emitBinary (OpType type, const Tensor *a, const Tensor *b) |
| Tensor * | emitTernary (OpType type, const Tensor *a, const Tensor *b, const Tensor *c) |
| Tensor * | emitMatMul (const Tensor *a, const Tensor *b) |
| Tensor * | emitTranspose (const Tensor *x) |
| Tensor * | emitPermute (const Tensor *x, const int *order, int rank) |
| Tensor * | emitReshape (const Tensor *x, const int *dims, int rank) |
| Tensor * | emitFill (const int *dims, int rank, float value) |
| Tensor * | emitSoftmax (const Tensor *x, int axis, bool logMode) |
| Tensor * | emitLayerNorm (const Tensor *x, const Tensor *scale, const Tensor *bias, float eps) |
| Tensor * | emitRMSNorm (const Tensor *x, const Tensor *scale, float eps) |
| Tensor * | emitConv1d (const Tensor *x, const Tensor *w, const Tensor *bias, int stride, int pad) |
| Tensor * | emitConv2d (const Tensor *x, const Tensor *w, const Tensor *bias, int stride, int pad) |
| Tensor * | emitPool (OpType type, const Tensor *x, int ksize, int stride, int pad) |
| Tensor * | emitEmbedding (const Tensor *table, const Tensor *indices) |
| Tensor * | emitConcat (const Tensor *const *ins, int n, int axis) |
| Tensor * | emitSlice (const Tensor *x, int axis, int begin, int end) |
| Tensor * | emitReduce (OpType type, const Tensor *x, int axis, bool keepDims) |
| Tensor * | emitArgMax (const Tensor *x, int axis, bool keepDims) |
| Tensor * | emitCast (const Tensor *x, DType dtype) |
| Tensor * | emitSdpa (const Tensor *q, const Tensor *k, const Tensor *v, const Tensor *mask, float scale) |
| Tensor * | emitResize2d (const Tensor *x, int outH, int outW, int mode) |
详细描述
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 | ( | ) |
◆ emitArgMax()
◆ emitBinary()
◆ emitCast()
◆ emitConcat()
◆ emitConv1d()
| Tensor * eve::tensor::Func::emitConv1d | ( | const Tensor * | x, |
| const Tensor * | w, | ||
| const Tensor * | bias, | ||
| int | stride, | ||
| int | pad | ||
| ) |
◆ emitConv2d()
| Tensor * eve::tensor::Func::emitConv2d | ( | const Tensor * | x, |
| const Tensor * | w, | ||
| const Tensor * | bias, | ||
| int | stride, | ||
| int | pad | ||
| ) |
◆ emitEmbedding()
◆ emitFill()
| Tensor * eve::tensor::Func::emitFill | ( | const int * | dims, |
| int | rank, | ||
| float | value | ||
| ) |
引用了 eve::tensor::Graph::addNode(), eve::tensor::Const, n , 以及 value.
◆ emitLayerNorm()
◆ emitMatMul()
◆ emitPermute()
◆ emitPool()
| Tensor * eve::tensor::Func::emitPool | ( | OpType | type, |
| const Tensor * | x, | ||
| int | ksize, | ||
| int | stride, | ||
| int | pad | ||
| ) |
◆ emitReduce()
◆ emitReshape()
◆ emitResize2d()
◆ emitRMSNorm()
◆ emitSdpa()
| Tensor * eve::tensor::Func::emitSdpa | ( | const Tensor * | q, |
| const Tensor * | k, | ||
| const Tensor * | v, | ||
| const Tensor * | mask, | ||
| float | scale | ||
| ) |
◆ emitSlice()
◆ emitSoftmax()
◆ emitTernary()
| Tensor * eve::tensor::Func::emitTernary | ( | OpType | type, |
| const Tensor * | a, | ||
| const Tensor * | b, | ||
| const Tensor * | c | ||
| ) |
引用了 a, eve::tensor::Graph::addNode(), b, c, ensureNode(), n, eve::tensor::Graph::node() , 以及 type.
◆ emitTranspose()
引用了 emitPermute(), ensureNode(), eve::tensor::Graph::node() , 以及 x.
◆ emitUnary()
引用了 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 |
||
| ) |
引用了 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, eve::tensor::Tensor::data(), eve::tensor::Tensor::ensureEager(), eve::tensor::Tensor::getSize(), eve::tensor::Tensor::graph(), eve::tensor::Tensor::isQuantized(), eve::tensor::Tensor::isSymbolic(), n, eve::tensor::Tensor::nodeId(), eve::tensor::Tensor::qBytes(), eve::tensor::Tensor::qGroup() , 以及 eve::tensor::Tensor::qScales().
被这些函数引用 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 | ) |
◆ input2()
| Tensor * eve::tensor::Func::input2 | ( | int | d0, |
| int | d1 | ||
| ) |
◆ input3()
| Tensor * eve::tensor::Func::input3 | ( | int | d0, |
| int | d1, | ||
| int | d2 | ||
| ) |
◆ input4()
| Tensor * eve::tensor::Func::input4 | ( | int | d0, |
| int | d1, | ||
| int | d2, | ||
| int | d3 | ||
| ) |
◆ input5()
| Tensor * eve::tensor::Func::input5 | ( | int | d0, |
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| int | d4 | ||
| ) |
◆ input6()
| Tensor * eve::tensor::Func::input6 | ( | int | d0, |
| int | d1, | ||
| int | d2, | ||
| int | d3, | ||
| int | d4, | ||
| int | d5 | ||
| ) |
◆ isTracing()
◆ outputNode()
◆ owner()
◆ placeholderCount()
◆ setOutput()
| void eve::tensor::Func::setOutput | ( | Tensor * | t | ) |
引用了 ensureNode().
该类的文档由以下文件生成: