helion.language.full
- helion.language.full(shape, value, dtype=torch.float32)[source]
Create a device-tensor filled with a specified value.
Note
Only use within
hl.tile()
loops for creating local tensors. For output tensor creation, usetorch.full()
with proper device placement.- Parameters:
- Returns:
A device tensor of the given shape and dtype filled with value
- Return type:
Examples
@helion.kernel def process_kernel(input: torch.Tensor) -> torch.Tensor: result = torch.empty_like(input) for tile in hl.tile(input.size(0)): # Create local buffer filled with initial value buffer = hl.full([tile], 0.0, dtype=input.dtype) buffer += input[tile] # Add input values to buffer result[tile] = buffer return result