本文整理汇总了Python中mxnet.module.base_module._parse_data_desc方法的典型用法代码示例。如果您正苦于以下问题:Python base_module._parse_data_desc方法的具体用法?Python base_module._parse_data_desc怎么用?Python base_module._parse_data_desc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mxnet.module.base_module
的用法示例。
在下文中一共展示了base_module._parse_data_desc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reshape
# 需要导入模块: from mxnet.module import base_module [as 别名]
# 或者: from mxnet.module.base_module import _parse_data_desc [as 别名]
def reshape(self, data_shapes, label_shapes=None):
"""Reshape the module for new input shapes.
Parameters
----------
data_shapes : list of (str, tuple)
Typically is `data_iter.provide_data`.
label_shapes : list of (str, tuple)
Typically is `data_iter.provide_label`.
"""
assert self.binded
# self._data_shapes, self._label_shapes = _parse_data_desc(
# self.data_names, self.label_names, data_shapes, label_shapes)
self._data_shapes, self._label_shapes = zip(*[_parse_data_desc(self.data_names, self.label_names, data_shape, label_shape)
for data_shape, label_shape in zip(data_shapes, label_shapes)])
self._exec_group.reshape(self._data_shapes, self._label_shapes)
示例2: reshape
# 需要导入模块: from mxnet.module import base_module [as 别名]
# 或者: from mxnet.module.base_module import _parse_data_desc [as 别名]
def reshape(self, data_shapes, label_shapes=None):
"""Reshape the module for new input shapes.
Parameters
----------
data_shapes : list of (str, tuple)
Typically is `data_iter.provide_data`.
label_shapes : list of (str, tuple)
Typically is `data_iter.provide_label`.
"""
assert self.binded
# self._data_shapes, self._label_shapes = _parse_data_desc(
# self.data_names, self.label_names, data_shapes, label_shapes)
self._data_shapes, self._label_shapes = zip(
*[
_parse_data_desc(self.data_names, self.label_names, data_shape, label_shape)
for data_shape, label_shape in zip(data_shapes, label_shapes)
]
)
self._exec_group.reshape(self._data_shapes, self._label_shapes)
示例3: reshape
# 需要导入模块: from mxnet.module import base_module [as 别名]
# 或者: from mxnet.module.base_module import _parse_data_desc [as 别名]
def reshape(self, data_shapes, label_shapes=None):
"""Reshapes the module for new input shapes.
Parameters
----------
data_shapes : list of (str, tuple)
Typically is ``data_iter.provide_data``.
label_shapes : list of (str, tuple)
Typically is ``data_iter.provide_label``.
"""
assert self.binded
self._data_shapes, self._label_shapes = _parse_data_desc(
self.data_names, self.label_names, data_shapes, label_shapes)
self._exec_group.reshape(self._data_shapes, self._label_shapes)