Professional Documents
Culture Documents
不同深度学习前端api定义对照表
不同深度学习前端api定义对照表
不同深度学习前端api定义对照表
kOpaque annotation.stop_fusion
kOpaque annotation.bitpack_start
kOpaque annotation.bitpack_end
kOpaque annotation.checkpoint
kOpaque annotation.compiler_begin
kOpaque annotation.compiler_end
kOpaque memory.alloc_storage
kOpaque memory.alloc_tensor
kOpaque memory.kill
kOpaque debug
kOpaque shape_of
kOpaque sliding_window
kOpaque argwhere
kOpaque scatter
kOpaque scatter_add
kOpaque scatter_nd
kOpaque arange
kOpaque sparse_fill_empty_rows
kOpaque stft
kOpaque sparse_to_dense
kOpaque cumsum
kOpaque cumprod
kOpaque unique
kOpaque device_copy
kOpaque on_device
kOpaque call_lowered
kOpaque dyn.sparse_to_dense
kOpaque nn.dropout
kCommReduce argmax
kCommReduce argmin
kCommReduce sum
kCommReduce all
kCommReduce any
kCommReduce max
kCommReduce min
kCommReduce prod
kCommReduce mean
kCommReduce variance
kBroadcast expand_dims
kBroadcast repeat
kBroadcast tile
kBroadcast where
kBroadcast broadcast_to
kBroadcast broadcast_to_like
kBroadcast dyn.broadcast_to(tvm/src/relay/op/dyn/tensor/transform.cc)
kBroadcast add
kBroadcast subtract
kBroadcast right_shift
kBroadcast left_shift
kBroadcast maximum
kBroadcast minimum
kBroadcast divide
kBroadcast trunc_divide
kBroadcast floor_divide
kBroadcast power
kBroadcast floor_mod
kBroadcast mod
kBroadcast trunc_mod
kBroadcast logical_and
kBroadcast logical_or
kBroadcast logical_xor
kBroadcast bitwise_and
kBroadcast bitwise_or
kBroadcast bitwise_xor
kBroadcast equal
kBroadcast not_equal
kBroadcast less
kBroadcast less_equal
kBroadcast greater
kBroadcast greater_equal
kInjective image.resize1d
kInjective image.resize2d
kInjective image.resize3d
kInjective image.crop_and_resize
kInjective nn.umsampling
kInjective nn.upsampling3d
kInjective dyn.reshape
kInjective dyn.tile
kInjective dyn.strided_slice
kInjective dyn.expand_dims
kInjective dyn.squeeze
kInjective concatenate
kInjective stack
kInjective transpose
kInjective reshape
kInjective reshape_like
kInjective take
kInjective sparse_reshape
kInjective meshgrid
kInjective reverse
kInjective reverse_sequence
kInjective squeeze
kInjective strided_slice
kInjective strided_set
kInjective split
kInjective slice_like
kInjective contrib_reverse_reshape
kInjective gather
kInjective gather_nd
kInjective sequence_mask
kInjective unravel_index
kInjective matrix_set_diag
kInjective adv_index
kInjective invert_permutation
kInjective dyn.nn.upsampling
kInjective dyn.nn.upsampling3d
kInjective image.affine_grid
kInjective image.grid_sample
kInjective einsum
kInjective nn.pad
kInjective nn.mirror_pad
kInjective dyn.nn.pad
kInjective dyn.image.resize2d
kInjective ndarray_size
kInjective nn.space_to_batch_nd
kInjective nn.batch_to_space_nd
elementwise clip
elementwise fixed_point_multiply
elementwise dyn.full
elementwise cast
elementwise cast_like
elementwise reinterpret
elementwise full
elementwise full_like
elementwise log
elementwise log2
elementwise log10
elementwise tan
elementwise cos
elementwise cosh
elementwise sin
elementwise sinh
elementwise acos
elementwise acosh
elementwise asin
elementwise asinh
elementwise atan
elementwise atanh
elementwise exp
elementwise fast_exp
elementwise erf
elementwise fast_erf
elementwise sqrt
elementwise rsqrt
elementwise ones_like
elementwise zeros_like
elementwise sigmoid
elementwise copy
elementwise floor
elementwise ceil
elementwise trunc
elementwise round
elementwise sign
elementwise abs
elementwise tanh
elementwise fast_tanh
elementwise negtive
elementwise logical_not
elementwise bitwise_not
elementwise isnan
elementwise isfinite
elementwise isinf
pytorch定义
torch.argmax(input, dim, keepdim=False) → LongTensor
torch.sum(input, *, dtype=None) → Tensor
torch.all(input, dim, keepdim=False, *, out=None) → Tensor
Tensor.expand(*sizes) → Tensor
Tensor.repeat(*sizes) → Tensor sizes (torch.Size or int...) – The number of times to rep
torch.where(condition, x, y) → Tensor
Return a tensor of elements selected from either x or y, depending on condition.
elay/op/dyn/tensor/transform.cc)
torch.maximum(input, other, *, out=None) → Tensor
torch.fmod(input, other, *, out=None) → Tensor torch.fmod(a, b) == a - a.div(b,
rounding_mode="trunc") * b input (Tensor) – the dividend
split_size_or_sections (int) or (list(int)) – size of a single chunk or list of sizes for each
chunk
Parameters
data (relay.Expr) – The input data to the operator.
axis (Union[int, Expr]) – The axis at which the input array is expanded. Should lie in range [-
data.ndim - 1, data.ndim]. If axis < 0, it is the first axis inserted; If axis >= 0, it is the last axis
inserted in Python’s negative indexing.
Returns
result – The reshaped result.
Return type
relay.Expr
tvm.relay.repeat(data, repeats, axis)
Repeats elements of an array. By default, repeat flattens the input array into 1-D and then repeats
the elements.
repeatsint
The number of repetitions for each element.
axis: int
The axis along which to repeat values. The negative numbers are interpreted counting from the
backward. By default, use the flattened input array, and return a flat output array.
Returns
ret – The computed result.
tvm.relay.tile(data, reps)
Repeats the whole array multiple times.
Return type
relay.Expr
Parameters
data (relay.Expr) – The input data to the operator.
reps (tuple of int or relay.Expr) – The number of times repeating the tensor data.
tvm.relay.where(condition, x, y)
Selecting elements from either x or y depending on the value of the condition.
tvm.relay.maximum(lhs, rhs)
tvm.relay.mod(lhs, rhs)
Mod with numpy-style broadcasting.
Parameters
lhs (relay.Expr) – The left hand side input data
Parameters
a_tuple (tuple of tvm.te.Tensor) – The arrays to concatenate
axis (int, optional) – The axis along which the arrays will be joined. Default is 0.
Returns
ret
Return type
tvm.te.Tensor
indexing (str) – Indexing mode, either “ij” for matrix indexing or “xy” for Cartesian indexing.
Returns
tvm.relay.reverse(data, axis)
ret – The computed result.
Reverses the order of elements along given axis while preserving array shape.
Return type
Parameters
relay.Tuple([relay.Expr, relay.Expr])
data (relay.Expr) – The input data to the operator.
Returns
ret – The computed result.
Return type
relay.Expr
其他基本相同
Parameters
data (relay.Expr) – The source array.
indices_or_sections (int or tuple of int) – Indices or sections to split into. Accepts an int or a tuple
Returns
ret – The computed result.
Return type
relay.Tuple([relay.Expr, relay.Expr])
tensorflow定义
tf.math.argmax(
input,
axis=None,
output_type=tf.dtypes.int64,
name=None
)
Reduces input along the dimensions given in axis. Unless keep_dims is true, the rank of the tensor
is reduced by 1 for each entry in axis. If keep_dims is true, the reduced dimensions are retained
with length 1.
Args:
tft.max(
x: common_types.TensorType,
reduce_instance_dims: bool = True,
name: Optional[str] = None
) -> tf.Tensor
scope: A Scope object
input: The tensor to reduce.
axis: The dimensions to reduce. Must be in the range [-rank(input), rank(input)).
Optional attributes (see Attrs):
tfp.stats.variance(
x, sample_axis=0, keepdims=False, name=None
)
Given a tensor input, this operation inserts a dimension of length 1 at the dimension index axis of
input's shape. The dimension index follows Python indexing rules: It's zero-based, a negative
index it is counted backward from the end.
tf.tile(
input, multiples, name=None
) multiples A Tensor. Must be one of the following types:
int32, int64. 1-D. Length must be the same as the number of dimensions in input
Return the indices of non-zero elements - When only condition is provided the result is an int64
tensor where each row is the index of a non-zero element of condition. The result's shape is
[tf.math.count_nonzero(condition), tf.rank(condition)].
Multiplex x and y - When both x and y are provided the result has the shape of x, y, and condition
broadcast together. The result is taken from x where condition is non-zero or y where condition is
zero.
tf.reshape(
tensor, shape, name=None
)
tf.experimental.numpy.take(
a, indices, axis=None, out=None, mode='clip'
)
value The Tensor to split.
num_or_size_splits Either an int indicating the number of splits along axis or a 1-D integer
Tensor or Python list containing the sizes of each output tensor along axis. If an int, then it must
evenly divide value.shape[axis]; otherwise the sum of sizes along the split axis must match that of
the value.
axis An int or scalar int32 Tensor. The dimension along which to split. Must be in the range [-
rank(value), rank(value)). Defaults to 0.
num Optional, an int, used to specify the number of outputs when it cannot be inferred from the
shape of size_splits.
name A name for the operation (optional).
keras定义
keras.backend.argmax(x, axis=-1)
/
repeat_elements
keras.backend.repeat_elements(x, rep, axis)
repeat
keras.backend.repeat(x, n)
重复一个 2D 张量。
tile
keras.backend.tile(x, n)
创建一个用 n 平铺 的 x 张量。
/
keras.layers.maximum(inputs)inputs: 一个列表的输入张量(列表
大小至少为 2)。
**kwargs: 层的关键字参数。
keras.layers.concatenate(inputs, axis=-1)
Concatenate 层的函数式接口。
参数
keras.backend.reshape(x, shape)
将张量重塑为指定的尺寸。
参数
x: 张量或变量。
shape: 目标尺寸元组。
描述
The STFT computes the Fourier transform of short overlapping windows of the input.
his operation returns the unique elements and the new index of each item in a given 1-D array
Copy data from one tensor to another. The source and destination
might be_x000D_
on different devices.
Computes the logical AND of boolean array elements over given axes.
Computes the logical AND of boolean array elements over given axes.
Computes the products of array elements over given axes.
Broadcast the first input to match the shape of the second input.
.........with broadcasting
Perform resize to input array with nearest neighbour or bilinear interpolation.
Perform crop and resize to input array with nearest neighbour or bilinear interpolation.
Perform upsampling on input array with nearest neighbour or bilinear interpolation.
Reshapes the input array based on the values in the newshape array.
Reshapes the input array where the special values are inferred from
Sets all elements outside the expected length of the sequence to a constant value.
Converts a flat index or array of flat indices into a tuple of coordinate arrays.
Returns a tensor with the diagonals of input tensor replaced with the provided diagonal values.
Returns the error function value for input array, computed element-wise.
Returns the fast_tanh of input array, computed element-wise.
Returns whether the input contains any NaN, computed element-wise.