triton.language.tensor¶
- class triton.language.tensor(self, handle, type: dtype)¶
Represents an N-dimensional array of values or pointers.
tensor
is the fundamental data structure in Triton programs. Most functions intriton.language
operate on and return tensors.Most of the named member functions here are duplicates of the free functions in
triton.language
. For example,triton.language.sqrt(x)
is equivalent tox.sqrt()
.tensor
also defines most of the magic/dunder methods, so you can writex+y
,x << 2
, etc.Constructors
- __init__(self, handle, type: dtype)¶
Not called by user code.
Methods
__init__
(self, handle, type)Not called by user code.
abs
(self)Forwards to
abs()
free functionadvance
(self, offsets)Forwards to
advance()
free functionargmax
(*self, **kwargs)Forwards to
argmax()
free functionargmin
(*self, **kwargs)Forwards to
argmin()
free functionassociative_scan
(self, axis, combine_fn[, ...])Forwards to
associative_scan()
free functionatomic_add
(self, val[, mask, sem, scope])Forwards to
atomic_add()
free functionatomic_and
(self, val[, mask, sem, scope])Forwards to
atomic_and()
free functionatomic_cas
(self, cmp, val[, sem, scope])Forwards to
atomic_cas()
free functionatomic_max
(self, val[, mask, sem, scope])Forwards to
atomic_max()
free functionatomic_min
(self, val[, mask, sem, scope])Forwards to
atomic_min()
free functionatomic_or
(self, val[, mask, sem, scope])Forwards to
atomic_or()
free functionatomic_xchg
(self, val[, mask, sem, scope])Forwards to
atomic_xchg()
free functionatomic_xor
(self, val[, mask, sem, scope])Forwards to
atomic_xor()
free functionbroadcast_to
(self, *shape)Forwards to
broadcast_to()
free functioncast
(self, dtype[, fp_downcast_rounding, ...])Forwards to
cast()
free functioncdiv
(*self, **kwargs)Forwards to
cdiv()
free functionceil
(self)Forwards to
ceil()
free functioncos
(self)Forwards to
cos()
free functioncumprod
(*self, **kwargs)Forwards to
cumprod()
free functioncumsum
(*self, **kwargs)Forwards to
cumsum()
free functionerf
(self)Forwards to
erf()
free functionexp
(self)Forwards to
exp()
free functionexp2
(self)Forwards to
exp2()
free functionexpand_dims
(self, axis)Forwards to
expand_dims()
free functionflip
(*self, **kwargs)Forwards to
flip()
free functionfloor
(self)Forwards to
floor()
free functionhistogram
(self, num_bins)Forwards to
histogram()
free functionlog
(self)Forwards to
log()
free functionlog2
(self)Forwards to
log2()
free functionlogical_and
(self, other)logical_or
(self, other)max
(*self, **kwargs)Forwards to
max()
free functionmin
(*self, **kwargs)Forwards to
min()
free functionpermute
(self, *dims)Forwards to
permute()
free functionravel
(*self, **kwargs)Forwards to
ravel()
free functionreduce
(self, axis, combine_fn[, keep_dims])Forwards to
reduce()
free functionreshape
(self, *shape[, can_reorder])Forwards to
reshape()
free functionrsqrt
(self)Forwards to
rsqrt()
free functionsigmoid
(*self, **kwargs)Forwards to
sigmoid()
free functionsin
(self)Forwards to
sin()
free functionsoftmax
(*self, **kwargs)Forwards to
softmax()
free functionsort
(*self, **kwargs)Forwards to
sort()
free functionsplit
(self)Forwards to
split()
free functionsqrt
(self)Forwards to
sqrt()
free functionsqrt_rn
(self)Forwards to
sqrt_rn()
free functionstore
(self, value[, mask, boundary_check, ...])Forwards to
store()
free functionsum
(*self, **kwargs)Forwards to
sum()
free functionto
(self, dtype[, fp_downcast_rounding, bitcast])Alias for
tensor.cast()
.trans
(self, *dims)Forwards to
trans()
free functionview
(self, *shape)Forwards to
view()
free functionxor_sum
(self[, axis, keep_dims])Forwards to
xor_sum()
free functionAttributes
T
Transposes a 2D tensor.