def test_4(self):
     graph = build_graph(nodes_attributes, edges,
                         {'slice_like': {
                             'axes': (-1, )
                         }})
     slice_like = Node(graph, 'slice_like')
     SliceLike.infer(slice_like)
     ref_shape = int64_array([3, 3])
     res_shape = graph.node['out_data']['shape']
     self.assertTrue(np.array_equal(res_shape, ref_shape))
Exemple #2
0
 def test_3(self):
     graph = build_graph(nodes_attributes, edges,
                         {'slice_like': {
                             'axes': (0, )
                         }})
     slice_like = Node(graph, 'slice_like')
     SliceLike.infer(slice_like)
     ref_shape = int64_array([2, 4])
     ref_value = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
     res_shape = graph.node['out_data']['shape']
     res_value = graph.node['out_data']['value']
     self.assertTrue(np.array_equal(res_shape, ref_shape))
     self.assertTrue(np.array_equal(res_value, ref_value))