cuda.tile.cat#
- cuda.tile.cat(tiles, /, axis)#
Concatenates two tiles along the axis.
- Parameters:
tiles (tuple) – a pair of tiles to concatenate.
axis (const int) – axis to concatenate the tiles.
- Return type:
Notes
Due to power-of-two assumption on all tile shapes, the two input tiles must have the same shape.
Examples
tx = ct.full((2, 2), 3, dtype=ct.int32) ty = ct.full((2, 2), 7, dtype=ct.int32) print(ct.cat((tx, ty), 0)) print(ct.cat((tx, ty), 1))
import cuda.tile as ct import torch @ct.kernel def kernel(): tx = ct.full((2, 2), 3, dtype=ct.int32) ty = ct.full((2, 2), 7, dtype=ct.int32) print(ct.cat((tx, ty), 0)) print(ct.cat((tx, ty), 1)) torch.cuda.init() ct.launch(torch.cuda.current_stream(), (1,), kernel, ()) torch.cuda.synchronize()
Output
[[3, 3], [3, 3], [7, 7], [7, 7]] [[3, 3, 7, 7], [3, 3, 7, 7]]