未验证 提交 68c1fe8c 编写于 作者: J Jiangxinz 提交者: GitHub

fix undef var (#33692)

上级 49638f25
......@@ -16,6 +16,7 @@ from __future__ import print_function
import paddle
from paddle.fluid import program_guard, layers, default_main_program
from paddle.fluid import default_startup_program
from .meta_optimizer_base import MetaOptimizerBase
from .common import OpRole, OP_ROLE_KEY, CollectiveHelper, is_update_op
......
......@@ -120,7 +120,7 @@ def _restore_batch(flat_batch, structure):
elif isinstance(field, (Sequence, Mapping)):
field_idx = _restore(structure[k], field_idx)
else:
raise TypeError("wrong flat data type: {}".format(type(batch)))
raise TypeError("wrong flat data type: {}".format(type(structure)))
return field_idx
......
......@@ -13,6 +13,7 @@
import sys
from .. import core
from . import ps_instance
from google.protobuf import text_format
__all__ = ['Fleet']
......
......@@ -46,7 +46,7 @@ class TestGroupNormOpError(unittest.TestCase):
def test_x_type():
input = np.random.random(2, 100, 3, 5).astype('float32')
goups = 2
groups = 2
fluid.layers.group_norm(input, groups)
self.assertRaises(TypeError, test_x_type)
......
......@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import warnings
from .optimizer import Optimizer
from ..fluid import core
from ..fluid import framework
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册