载入中...
搜索中...
未找到
eve::tensor::Func类 参考

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.

在文件 Graph.h 第 137 行定义.

构造及析构函数说明

◆ Func()

eve::tensor::Func::Func ( TF *  owner)
explicit

Func.

在文件 Graph.cpp 第 20 行定义.

引用了 eve::tensor::TF::pushTrace().

◆ ~Func()

eve::tensor::Func::~Func ( )

Func.

在文件 Graph.cpp 第 25 行定义.

引用了 eve::tensor::TF::popTrace().

成员函数说明

◆ compile()

CompiledFunction * eve::tensor::Func::compile ( )

Compiles compile.

在文件 Graph.cpp 第 567 行定义.

引用了 eve::tensor::CompiledFunction::fromFunc() , 以及 eve::tensor::TF::popTrace().

◆ emitArgMax()

Tensor * eve::tensor::Func::emitArgMax ( const Tensor *  x,
int  axis,
bool  keepDims 
)

◆ emitBinary()

Tensor * eve::tensor::Func::emitBinary ( OpType  type,
const Tensor *  a,
const Tensor *  b 
)

◆ emitCast()

Tensor * eve::tensor::Func::emitCast ( const Tensor *  x,
DType  dtype 
)

◆ emitConcat()

Tensor * eve::tensor::Func::emitConcat ( const Tensor *const *  ins,
int  n,
int  axis 
)

◆ emitConv1d()

Tensor * eve::tensor::Func::emitConv1d ( const Tensor *  x,
const Tensor *  w,
const Tensor *  bias,
int  stride,
int  pad 
)

Emit conv 1 d.

在文件 Graph.cpp 第 316 行定义.

引用了 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.

在文件 Graph.cpp 第 341 行定义.

引用了 eve::tensor::Graph::addNode(), bias, eve::tensor::Conv2d, ensureNode(), n, eve::tensor::Graph::node(), nx, pad, w , 以及 x.

◆ emitEmbedding()

Tensor * eve::tensor::Func::emitEmbedding ( const Tensor *  table,
const Tensor *  indices 
)

◆ emitFill()

Tensor * eve::tensor::Func::emitFill ( const int *  dims,
int  rank,
float  value 
)

Emit fill.

在文件 Graph.cpp 第 133 行定义.

引用了 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 
)

◆ emitMatMul()

Tensor * eve::tensor::Func::emitMatMul ( const Tensor *  a,
const Tensor *  b 
)

Emit mat mul.

在文件 Graph.cpp 第 191 行定义.

引用了 a, eve::tensor::Graph::addNode(), b, ensureNode(), eve::tensor::MatMul, n , 以及 eve::tensor::Graph::node().

◆ emitPermute()

Tensor * eve::tensor::Func::emitPermute ( const Tensor *  x,
const int *  order,
int  rank 
)

Emit permute.

在文件 Graph.cpp 第 226 行定义.

引用了 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 
)

◆ emitReduce()

Tensor * eve::tensor::Func::emitReduce ( OpType  type,
const Tensor *  x,
int  axis,
bool  keepDims 
)

◆ emitReshape()

Tensor * eve::tensor::Func::emitReshape ( const Tensor *  x,
const int *  dims,
int  rank 
)

◆ emitResize2d()

Tensor * eve::tensor::Func::emitResize2d ( const Tensor *  x,
int  outH,
int  outW,
int  mode 
)

◆ emitRMSNorm()

Tensor * eve::tensor::Func::emitRMSNorm ( const Tensor *  x,
const Tensor *  scale,
float  eps 
)

◆ emitSdpa()

Tensor * eve::tensor::Func::emitSdpa ( const Tensor *  q,
const Tensor *  k,
const Tensor *  v,
const Tensor *  mask,
float  scale 
)

◆ emitSlice()

Tensor * eve::tensor::Func::emitSlice ( const Tensor *  x,
int  axis,
int  begin,
int  end 
)

◆ emitSoftmax()

Tensor * eve::tensor::Func::emitSoftmax ( const Tensor *  x,
int  axis,
bool  logMode 
)

◆ emitTernary()

Tensor * eve::tensor::Func::emitTernary ( OpType  type,
const Tensor *  a,
const Tensor *  b,
const Tensor *  c 
)

Emit ternary.

在文件 Graph.cpp 第 178 行定义.

引用了 a, eve::tensor::Graph::addNode(), b, c, ensureNode(), n, eve::tensor::Graph::node() , 以及 type.

◆ emitTranspose()

Tensor * eve::tensor::Func::emitTranspose ( const Tensor *  x)

Emit transpose.

在文件 Graph.cpp 第 218 行定义.

引用了 emitPermute(), ensureNode(), eve::tensor::Graph::node(), order , 以及 x.

◆ emitUnary()

Tensor * eve::tensor::Func::emitUnary ( OpType  type,
const Tensor *  x 
)

Emit unary.

在文件 Graph.cpp 第 140 行定义.

引用了 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.

在文件 Graph.cpp 第 150 行定义.

引用了 eve::tensor::Graph::addNode(), ensureNode(), n, eve::tensor::Graph::node(), type , 以及 x.

◆ ensureNode()

int eve::tensor::Func::ensureNode ( const Tensor *  t)

◆ graph() [1/2]

Graph & eve::tensor::Func::graph ( )
inline

Graph.

在文件 Graph.h 第 164 行定义.

◆ graph() [2/2]

const Graph & eve::tensor::Func::graph ( ) const
inline

Graph.

在文件 Graph.h 第 166 行定义.

◆ input1()

Tensor * eve::tensor::Func::input1 ( int  d0)

Input 1.

在文件 Graph.cpp 第 73 行定义.

引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.

◆ input2()

Tensor * eve::tensor::Func::input2 ( int  d0,
int  d1 
)

Input 2.

在文件 Graph.cpp 第 79 行定义.

引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.

◆ input3()

Tensor * eve::tensor::Func::input3 ( int  d0,
int  d1,
int  d2 
)

Input 3.

在文件 Graph.cpp 第 85 行定义.

引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.

◆ input4()

Tensor * eve::tensor::Func::input4 ( int  d0,
int  d1,
int  d2,
int  d3 
)

Input 4.

在文件 Graph.cpp 第 91 行定义.

引用了 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.

在文件 Graph.cpp 第 97 行定义.

引用了 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.

在文件 Graph.cpp 第 103 行定义.

引用了 eve::tensor::Graph::addNode(), d , 以及 eve::tensor::Placeholder.

◆ isTracing()

bool eve::tensor::Func::isTracing ( ) const
inline

True when tracing.

在文件 Graph.h 第 170 行定义.

◆ outputNode()

int eve::tensor::Func::outputNode ( ) const
inline

Output node.

在文件 Graph.h 第 172 行定义.

◆ owner()

TF * eve::tensor::Func::owner ( ) const
inline

Owner.

在文件 Graph.h 第 168 行定义.

◆ placeholderCount()

int eve::tensor::Func::placeholderCount ( ) const
inline

Placeholder count.

在文件 Graph.h 第 174 行定义.

◆ setOutput()

void eve::tensor::Func::setOutput ( Tensor *  t)

Sets the output.

在文件 Graph.cpp 第 109 行定义.

引用了 ensureNode() , 以及 t.


该类的文档由以下文件生成: