triton.language.tensor

triton.language.tensor#

class triton.language.tensor(handle, type: dtype)#

Represents an N-dimensional array of values or pointers.

tensor is the fundamental data structure in Triton programs. Most functions in triton.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 to x.sqrt().

tensor also defines most of the magic/dunder methods, so you can write x+y, x << 2, etc.

__init__(handle, type: dtype)#

Not called by user code.

Methods

__init__(name)

Initialize self.

abs

advance

argmax

argmin

associative_scan

atomic_add

atomic_and

atomic_cas

atomic_max

atomic_min

atomic_or

atomic_xchg

atomic_xor

broadcast_to

cast

cdiv

ceil

cos

cumprod

cumsum

erf

exp

exp2

expand_dims

flip

floor

gather

histogram

item

log

log2

logical_and

logical_or

max

min

permute

ravel

reduce

reduce_or

reshape

rsqrt

sigmoid

sin

softmax

sort

split

sqrt

sqrt_rn

store

sum

to

trans

view

xor_sum

Attributes

T

type