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还定义了大多数魔术/双下划线(dunder)方法,因此您可以编写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 张量。
类型