Shortcuts

mmeval.core.dispatch

mmeval.core.dispatch = <mmeval.core.dispatcher._MMEvalDispatcher object>

A Dispatcher inherited from plum.Dispatcher that resolve typing.ForwardRef.

This dispatcher tries to use importlib.import_moudle to import ForwardRerf type and convert unimportable type as a placeholder.

With the _MMEvalDispatcher, we can run the following code example without PyTorch installed, which is plum.dispatch can’t do.

Example

>>> from mmeval.core import dispatch
>>> @dispatch
>>> def compute(x: 'torch.Tensor'):
...     print('The input is a `torch.Tensor`')
>>> @dispatch
>>> def compute(x: 'numpy.ndarray'):
...     print('The input is a `numpy.ndarray`')
Read the Docs v: latest
Versions
latest
stable
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.