Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 848 Bytes

File metadata and controls

35 lines (23 loc) · 848 Bytes

Scal Kernel

The scal operator scales the elements of a tensor by a given scalar factor.

Mathematical Definition

Given a scalar alpha and an input tensor y, the kernel evaluates

$$ y = \alpha y $$

The scaling is performed element by element, multiplying each entry of y by alpha.

Kernel Implementations

All backends share the interface:

def scal(y: torch.Tensor, alpha: float) -> torch.Tensor:
    ...

Testing

See the test suite for the validation harness that exercises every backend.

pytest tests/test_scal.py -s