示例#1
0
 def test_xml_shape(self):
     net = Element('net')
     xml_shape(np.array([2, 10, 50, 50], dtype=np.int64), net)
     self.assertEqual(tostring(net), expected_result)
示例#2
0
 def test_xml_shape_non_integer_values(self):
     net = Element('net')
     with self.assertRaises(Error):
         xml_shape(np.array([2.0, 10.0, 50.0, 50.5], dtype=np.float32), net)
示例#3
0
 def test_xml_shape_negative_values(self):
     net = Element('net')
     with self.assertRaises(Error):
         xml_shape(np.array([2, 10, 50, -50], dtype=np.int64), net)
示例#4
0
 def test_xml_shape_float_values(self):
     net = Element('net')
     xml_shape(np.array([2.0, 10.0, 50.0, 50.0], dtype=np.float32), net)
     self.assertEqual(tostring(net), expected_result)