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)
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)
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)
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)