NoGrad

class hybrid_learning.datasets.transforms.image_transforms.NoGrad[source]

Bases: ImageTransform

Disable requires_grad for the given tensors.

Public Data Attributes:

Inherited from : py: class:Transform

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings to reproduce the instance.

Public Methods:

apply_to(tens)

Set requires_grad to False for tens in-place.

Inherited from : py: class:ImageTransform

apply_to(tens)

Set requires_grad to False for tens in-place.

Inherited from : py: class:Transform

apply_to(tens)

Set requires_grad to False for tens in-place.

Special Methods:

Inherited from : py: class:ImageTransform

__call__(img)

Application of transformation.

Inherited from : py: class:Transform

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

__copy__()

Return a shallow copy of self using settings.

__add__(other)

Return a flat composition of self with other.

__radd__(other)

Return a flat composition of other and self.

__call__(img)

Application of transformation.


apply_to(tens)[source]

Set requires_grad to False for tens in-place.

Parameters

tens (Tensor) –

Return type

Tensor