AsBatch

class hybrid_learning.datasets.transforms.image_transforms.AsBatch(trafo, batch_wise=False)[source]

Bases: BatchWiseImageTransform

Ensure that the given transformation is fed with a batch of inputs. batch_wise determines whether inputs are assumed to already be batches or not. The output is the same as the input (batch or not).

Public Data Attributes:

Inherited from : py: class:BatchWiseImageTransform

settings

Settings to reproduce the instance.

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_batch(batch)

Feed the batch to trafo.

Inherited from : py: class:BatchWiseImageTransform

apply_to(mask)

Apply trafo to the mask (either considered as batch of mask or single mask).

apply_to_batch(batch)

Feed the batch to trafo.

Inherited from : py: class:ImageTransform

apply_to(mask)

Apply trafo to the mask (either considered as batch of mask or single mask).

Inherited from : py: class:Transform

apply_to(mask)

Apply trafo to the mask (either considered as batch of mask or single mask).

Special Methods:

__init__(trafo[, batch_wise])

Inherited from : py: class:BatchWiseImageTransform

__init__(trafo[, batch_wise])

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.


Parameters
__init__(trafo, batch_wise=False)[source]
Parameters
apply_to_batch(batch)[source]

Feed the batch to trafo.

Parameters

batch (Tensor) –

Return type

Tensor

trafo: Callable[[Tensor], Tensor]

The transformation that requires batch-wise input.