gluonts.mx.context module#

class gluonts.mx.context.MXContext[source]#

Bases: object

Defines `custom data type validation.

<https://pydantic-docs.helpmanual.io/#custom-data-types>`_ for the Context data type.

classmethod validate(v: Union[str, mxnet.context.Context]) mxnet.context.Context[source]#
gluonts.mx.context.check_gpu_support() bool[source]#

Emits a log line and returns a boolean that indicate whether the currently installed MXNet version has GPU support.

gluonts.mx.context.get_mxnet_context(gpu_number=0) mxnet.context.Context[source]#

Returns either CPU or GPU context.

gluonts.mx.context.num_gpus(refresh=False)[source]#