triton.language.tensor¶
- class triton.language.tensor(self, handle, type: dtype)¶
表示一个 N 维的值或指针数组。
tensor是 Triton 程序中的基本数据结构。triton.language中的大多数函数都对张量进行操作并返回张量。这里大多数命名的成员函数都是
triton.language中独立函数的副本。例如,triton.language.sqrt(x)等同于x.sqrt()。tensor也定义了大多数魔法/双下划线方法,因此你可以编写x+y、x << 2等表达式。构造函数
- __init__(self, handle, type: dtype)¶
不由用户代码调用。
方法
__init__(self, handle, type)不由用户代码调用。
abs(self[, _semantic])转发至
abs()独立函数advance(self, offsets[, _semantic])转发至
advance()独立函数argmax(input, axis[, tie_break_left, keep_dims])返回
input张量中沿给定axis的所有元素的最大索引。argmin(input, axis[, tie_break_left, keep_dims])返回
input张量中沿给定axis的所有元素的最小索引。associative_scan(self, axis, combine_fn[, ...])转发至
associative_scan()独立函数atomic_add(self, val[, mask, sem, scope, ...])转发至
atomic_add()独立函数atomic_and(self, val[, mask, sem, scope, ...])转发至
atomic_and()独立函数atomic_cas(self, cmp, val[, sem, scope, ...])转发至
atomic_cas()独立函数atomic_max(self, val[, mask, sem, scope, ...])转发至
atomic_max()独立函数atomic_min(self, val[, mask, sem, scope, ...])转发至
atomic_min()独立函数atomic_or(self, val[, mask, sem, scope, ...])转发至
atomic_or()独立函数atomic_xchg(self, val[, mask, sem, scope, ...])转发至
atomic_xchg()独立函数atomic_xor(self, val[, mask, sem, scope, ...])转发至
atomic_xor()独立函数broadcast_to(self, *shape[, _semantic])转发至
broadcast_to()独立函数cast(self, dtype[, fp_downcast_rounding, ...])转发至
cast()独立函数cdiv(x, div)计算
x除以div的向上取整除法。ceil(self[, _semantic])转发至
ceil()独立函数cos(self[, _semantic])转发至
cos()独立函数cumprod(input[, axis, reverse])返回
input张量中沿给定axis的所有元素的累积积。cumsum(input[, axis, reverse, dtype])返回
input张量中沿给定axis的所有元素的累积和。erf(self[, _semantic])转发至
erf()独立函数exp(self[, _semantic])转发至
exp()独立函数exp2(self[, _semantic])转发至
exp2()独立函数expand_dims(self, axis[, _semantic])转发至
expand_dims()独立函数flip(x[, dim])沿维度 dim 翻转张量 x。
floor(self[, _semantic])转发至
floor()独立函数gather(self, index, axis[, _semantic])转发至
gather()独立函数histogram(self, num_bins[, mask, _semantic, ...])转发至
histogram()独立函数item(self[, _semantic, _generator])转发至
item()独立函数log(self[, _semantic])转发至
log()独立函数log2(self[, _semantic])转发至
log2()独立函数logical_and(self, other[, _semantic])logical_or(self, other[, _semantic])max(input[, axis, return_indices, ...])返回
input张量中沿给定axis的所有元素的最大值。min(input[, axis, return_indices, ...])返回
input张量中沿给定axis的所有元素的最小值。permute(self, *dims[, _semantic])转发至
permute()独立函数ravel(x[, can_reorder])返回
x的连续扁平视图。reduce(self, axis, combine_fn[, keep_dims, ...])转发至
reduce()独立函数reduce_or(input, axis[, keep_dims])返回
input张量中沿指定axis的所有元素的 reduce_or 结果reshape(self, *shape[, can_reorder, ...])转发至
reshape()独立函数rsqrt(self[, _semantic])转发至
rsqrt()独立函数sigmoid(x)计算
x的元素级 Sigmoid。sin(self[, _semantic])转发至
sin()独立函数softmax(x[, dim, keep_dims, ieee_rounding])计算
x的元素级 Softmax。sort(self[, dim, descending])split(self[, _semantic, _generator])转发至
split()独立函数sqrt(self[, _semantic])转发至
sqrt()独立函数sqrt_rn(self[, _semantic])转发至
sqrt_rn()独立函数store(self, value[, mask, boundary_check, ...])转发至
store()独立函数sum(input[, axis, keep_dims, dtype])返回
input张量中沿给定axis的所有元素的和。to(self, dtype[, fp_downcast_rounding, ...])tensor.cast()的别名。trans(self, *dims[, _semantic])转发至
trans()独立函数view(self, *shape[, _semantic])转发至
view()独立函数xor_sum(input[, axis, keep_dims])返回
input张量中沿给定axis的所有元素的异或和。属性
T转置一个 2D 张量。
类型