helion.language.arange#
- helion.language.arange(*args, dtype=None, device=None, **kwargs)[source]#
Same as torch.arange(), but defaults to same device as the current kernel.
Creates a 1D tensor containing a sequence of integers in the specified range, automatically using the current kernel’s device and index dtype.
- Parameters:
args (
int) – Positional arguments passed to torch.arange(start, end, step).dtype (
dtype|None) – Data type of the result tensor (defaults to kernel’s index dtype)device (
device|None) – Device must match the current compile environment devicekwargs (
object) – Additional keyword arguments passed to torch.arange
- Returns:
1D tensor containing the sequence
- Return type:
See also
tile_index(): For getting tile indiceszeros(): For creating zero-filled tensorsfull(): For creating constant-filled tensors