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

[fix] print self in warning. #15614

Merged
merged 3 commits into from
Jul 21, 2019
Merged
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
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