gluonts.mx.batchify module#

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

将数据移动到新的上下文中,仅应在主进程中进行。

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]#

在指定轴上(默认为第一个轴)用 0 右填充(默认为右侧)xs

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]#