triton.language.to_tensor
- triton.language.to_tensor(x, _semantic=None)
Converts a Python scalar into a 0-dimensional
tensor.If
xis already atensorit is returned unchanged. The result dtype is inferred from the value: a Pythonboolbecomestl.int1, anintbecomes the smallest oftl.int32,tl.uint32,tl.int64, ortl.uint64that can represent it, and afloatbecomestl.float32(ortl.float64when it is outside thefloat32range).- Parameters:
x – any numeric value.