Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Fix for D2L chapter 11 #15244

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/mxnet/gluon/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def _reduce(self):
ctx = context.cpu()
if self._stype == 'default':
block = self.list_data()
data = ndarray.add_n(*(w.copyto(ctx) for w in block)) / len(block)
data = ndarray.add_n(*(w.copyto(ctx).as_nd_ndarray() for w in block)) / len(block)
else:
# fetch all rows for 'row_sparse' param
all_row_ids = ndarray.arange(0, self.shape[0], dtype='int64', ctx=ctx)
Expand Down
1 change: 1 addition & 0 deletions python/mxnet/numpy_extension/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
from ..util import use_np_shape, np_shape, is_np_shape
from ..util import use_np_array, np_array, is_np_array
from ..util import set_np, use_np, reset_np
from ..ndarray import waitall

__all__ = []