spyrit.core.prep.Rerange.forward

Rerange.forward(x: tensor) tensor[source]

Applies the affine transform to the input tensor.

It corresponds to the affine transformation that maps the input range \([x,y]\) to the output range \([a,b]\).

Args:

x (torch.tensor): The input tensor to apply the affine transform to. Has arbitrary shape.

Returns:

torch.tensor: The input tensor with the affine transform applied. It has the same shape as the input tensor.