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)

转发到 abs() 自由函数

advance(self, offsets)

转发至advance()自由函数

argmax(*self, **kwargs)

转发到argmax()自由函数

argmin(*self, **kwargs)

转发到argmin()自由函数

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)

转发至broadcast_to()自由函数

cast(self, dtype[, fp_downcast_rounding, ...])

转发到 cast() 自由函数

cdiv(*self, **kwargs)

转发至cdiv()自由函数

ceil(self)

转发到 ceil() 自由函数

cos(self)

转发到 cos() 自由函数

cumprod(*self, **kwargs)

转发到cumprod()自由函数

cumsum(*self, **kwargs)

转发到 cumsum() 自由函数

erf(self)

转发至erf()自由函数

exp(self)

转发到 exp() 自由函数

exp2(self)

转发到exp2()自由函数

expand_dims(self, axis)

转发到expand_dims()自由函数

flip(*self, **kwargs)

转发到flip()自由函数

floor(self)

转发到 floor() 自由函数

gather(self, index, axis)

转发至gather()自由函数

histogram(self, num_bins)

转发到histogram()自由函数

log(self)

转发到 log() 自由函数

log2(self)

转发到 log2() 自由函数

logical_and(self, other)

logical_or(self, other)

max(*self, **kwargs)

转发到 max() 自由函数

min(*self, **kwargs)

转发到 min() 自由函数

permute(self, *dims)

转发到permute()自由函数

ravel(*self, **kwargs)

转发至ravel()自由函数

reduce(self, axis, combine_fn[, keep_dims])

转发至reduce()自由函数

reshape(self, *shape[, can_reorder])

转发到reshape()自由函数

rsqrt(self)

转发到rsqrt()自由函数

sigmoid(*self, **kwargs)

转发到sigmoid()自由函数

sin(self)

转发到 sin() 自由函数

softmax(*self, **kwargs)

转发至softmax()自由函数

sort(self[, dim, descending])

split(self)

转发到split()自由函数

sqrt(self)

转发到 sqrt() 自由函数

sqrt_rn(self)

转发到 sqrt_rn() 自由函数

store(self, value[, mask, boundary_check, ...])

转发到store()自由函数

sum(*self, **kwargs)

转发到sum()自由函数

to(self, dtype[, fp_downcast_rounding, bitcast])

tensor.cast()的别名。

trans(self, *dims)

转发到trans()自由函数

view(self, *shape)

转发到view()自由函数

xor_sum(*self, **kwargs)

转发到xor_sum()自由函数

属性

T

转置一个二维张量。

type