From 0341eb99e40402ea4a17b7d1ae9b9e2c967b9e57 Mon Sep 17 00:00:00 2001 From: kshitij12345 Date: Sun, 21 Jul 2019 07:48:29 +0530 Subject: [PATCH] [fix] print `self` in warning. (#15614) * use format * make pylint happy * Update block.py --- python/mxnet/gluon/block.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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):