Rescale#

class deepinv.datasets.utils.Rescale(*args, rescale_mode: str = 'min_max', **kwargs)[source]#

Bases: Module

Image value rescale torchvision-style transform.

The transform expects tensor of shape (…, H, W) and performs rescale over all dimensions (i.e. over all images in batch).

Parameters:

rescale_mode (str) – rescale mode, either “min_max” or “clip”.

forward(x: Tensor)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.