gluonts.mx.batchify module#

gluonts.mx.batchify.as_in_context(batch: dict, ctx: Optional[mxnet.context.Context] = None) Dict[str, Any][source]#

Move data into new context, should only be in main process.

gluonts.mx.batchify.batchify(data: typing.List[dict], ctx: typing.Optional[mxnet.context.Context] = None, dtype: typing.Optional[typing.Type] = <class 'numpy.float32'>, variable_length: bool = False, is_right_pad: bool = True) Dict[str, Any][source]#
gluonts.mx.batchify.pad_to_size(x: numpy.ndarray, size: int, axis: int = 0, is_right_pad: bool = True)[source]#

Pads xs with 0 on the right (default) on the specified axis, which is the first axis by default.

gluonts.mx.batchify.stack(data, ctx: typing.Optional[mxnet.context.Context] = None, dtype: typing.Optional[typing.Type] = <class 'numpy.float32'>, variable_length: bool = False, is_right_pad: bool = True)[source]#