Skip to content

Commit 3632e8f

Browse files
fix bug
1 parent ee69f28 commit 3632e8f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_shape_inference.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def _run_test_case(self, graph, feed_dict):
3535
raised = False
3636
try:
3737
results = self.run_backend(graph, outputs, feed_dict)
38-
except: # pylint: disable=bare-except
38+
except Exception as ex: # pylint: disable=broad-except
39+
self.logger.error(ex)
3940
raised = True
4041
self.assertFalse(raised)
4142

@@ -45,7 +46,8 @@ def _run_test_case(self, graph, feed_dict):
4546
inferred_shape = tuple(graph.get_shape(inferred))
4647
try:
4748
utils.merge_shapes(actual_shape, inferred_shape)
48-
except: # pylint: disable=bare-except
49+
except Exception as ex: # pylint: disable=broad-except
50+
self.logger.error(ex)
4951
raised = True
5052
self.assertFalse(raised)
5153

@@ -271,7 +273,7 @@ def test_constant_of_shape(self):
271273
self._run_test_case(graph, self._generate_random_inputs(inputs, shapes, dtypes))
272274

273275
graph = self._create_empty_graph([], [], [])
274-
const = graph.make_const("shape", np.array([3, 5, 6]))
276+
const = graph.make_const("shape", np.array([3, 5, 6], dtype=np.int64))
275277
node = graph.make_node("ConstantOfShape", [const.output[0]])
276278
graph.add_graph_output(node.output[0])
277279
self._run_test_case(graph, self._generate_random_inputs([], [], []))

0 commit comments

Comments
 (0)