Fix UnboundLocalError: local variable 'tensor' referenced before assignment (#3074)
authorOuHangKresnik <ouhang.kresnik.zero@gmail.com>
Wed, 24 Apr 2019 22:17:40 +0000 (06:17 +0800)
committerLianmin Zheng <lianminzheng@gmail.com>
Wed, 24 Apr 2019 22:17:40 +0000 (06:17 +0800)
topi/python/topi/opengl/pooling.py

index 95dc561..99c4dec 100644 (file)
@@ -107,8 +107,8 @@ def schedule_pool(outs, layout):
         if tag.is_broadcast(OP.tag):
             if OP not in s.outputs:
                 s[OP].compute_inline()
-            for tensor in OP.input_tensors and tensor.op not in scheduled_ops:
-                if tensor.op.input_tensors:
+            for tensor in OP.input_tensors:
+                if tensor.op not in scheduled_ops and tensor.op.input_tensors:
                     traverse(tensor.op)
         # schedule pool
         elif OP.tag.startswith('pool'):