cuda.tile.ones#
- cuda.tile.ones(shape, dtype)#
Creates a tile filled with ones.
- Parameters:
- Return type:
Examples
tile = ct.ones((2, 2), dtype=ct.int32) print(tile)
import cuda.tile as ct import torch @ct.kernel def kernel(): tile = ct.ones((2, 2), dtype=ct.int32) print(tile) torch.cuda.init() ct.launch(torch.cuda.current_stream(), (1,), kernel, ()) torch.cuda.synchronize()
Output
[[1, 1], [1, 1]]