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

Commit

Permalink
clean code remove cargs
Browse files Browse the repository at this point in the history
  • Loading branch information
guanxinq committed Feb 4, 2020
1 parent b037872 commit 80dfaed
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions python/mxnet/gluon/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,19 +970,15 @@ def _build_cache(self, *args):
self._flags

args, _ = _flatten(args, "input")
args_without_none = [ele for ele in args if ele is not None]
try:
cargs = [args_without_none[i] if is_arg else i.data()
for is_arg, i in self._cached_op_args]
for is_arg, i in self._cached_op_args:
if not is_arg:
i.data()
except DeferredInitializationError:
self._deferred_infer_shape(*args)
cargs = []
for is_arg, i in self._cached_op_args:
if is_arg:
cargs.append(args_without_none[i])
else:
if not is_arg:
i._finish_deferred_init()
cargs.append(i.data())

if self._backend:
ctx = args[0].context
Expand Down

0 comments on commit 80dfaed

Please sign in to comment.