Rate this Page

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 device

  • kwargs (object) – Additional keyword arguments passed to torch.arange

Returns:

1D tensor containing the sequence

Return type:

torch.Tensor

See also

  • tile_index(): For getting tile indices

  • zeros(): For creating zero-filled tensors

  • full(): For creating constant-filled tensors