cuda.tile.negative#
- cuda.tile.negative(x, /)#
Same as -x.
Examples
tx = ct.arange(4, dtype=ct.int32) ty = -tx print(ty)
import cuda.tile as ct import torch @ct.kernel def kernel(): tx = ct.arange(4, dtype=ct.int32) ty = -tx print(ty) torch.cuda.init() ct.launch(torch.cuda.current_stream(), (1,), kernel, ()) torch.cuda.synchronize()
Output
[0, -1, -2, -3]