helion.language.load

helion.language.load(tensor, index, extra_mask=None)[source]

Load a value from a tensor using a list of indices.

This function is equivalent to tensor[index] but allows setting extra_mask= to mask elements beyond the default masking based on the hl.tile range.

Parameters:
  • tensor (Tensor) – The tensor to load from

  • index (list[object]) – The indices to use to index into the tensor

  • extra_mask (Tensor | None) – The extra mask (beyond automatic tile bounds masking) to apply to the tensor

Returns:

The loaded value

Return type:

torch.Tensor