Skip to content

Commit

Permalink
[fix] print self in warning. (apache#15614)
Browse files Browse the repository at this point in the history
* use format

* make pylint happy

* Update block.py
  • Loading branch information
kshitij12345 authored and Ubuntu committed Aug 20, 2019
1 parent a32b39b commit 0341eb9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/mxnet/gluon/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,9 @@ def hybridize(self, active=True, **kwargs):
self._flags = list(kwargs.items())
self._clear_cached_op()
if active and self._forward_hooks or self._forward_pre_hooks:
warnings.warn('"{}" is being hybridized while still having forward hook/pre-hook. '
'If "{}" is a child of HybridBlock, the hooks will not take effect.')
warnings.warn('"{block}" is being hybridized while still having forward hook/pre-hook. '
'If "{block}" is a child of HybridBlock, the hooks will not take effect.'
.format(block=self))
super(HybridBlock, self).hybridize(active, **kwargs)

def cast(self, dtype):
Expand Down

0 comments on commit 0341eb9

Please sign in to comment.