diff --git a/python/mxnet/gluon/block.py b/python/mxnet/gluon/block.py index 3bac3c023bf8..bd22cf85d561 100644 --- a/python/mxnet/gluon/block.py +++ b/python/mxnet/gluon/block.py @@ -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):