chainer.dataset.Converter

class chainer.dataset.Converter[source]

Base class of converters.

Converters receive batched data retrieved from iterators and perform arbitrary transforms as well as device transfer.

Implementation should override the __call__ method.

See also

chainer.dataset.converter() — a decorator to turn a converter function into a Converter instance.

Methods

__call__(batch, device)[source]

Performs conversion.

Parameters
  • batch – A batch. The type and value are arbitrary, depending on usage.

  • device (Device) – Device to which the converter is expected to send the batch.

Returns: A converted batch.

__eq__()

Return self==value.

__ne__()

Return self!=value.

__lt__()

Return self<value.

__le__()

Return self<=value.

__gt__()

Return self>value.

__ge__()

Return self>=value.