Skip to content

Commit a21651b

Browse files
authored
update version to 3.4 (#712)
1 parent a63319b commit a21651b

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

coremltools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
For more information: http://developer.apple.com/documentation/coreml
2323
"""
2424

25-
__version__ = '3.3'
25+
__version__ = '3.4'
2626

2727
# This is the basic Core ML specification format understood by iOS 11.0
2828
SPECIFICATION_VERSION = 1

coremltools/test/neural_network/test_graph_passes.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import copy
1010
import pytest
1111
from sys import platform
12+
from coremltools.models.utils import macos_version
1213

1314
DEBUG = False
1415
np.random.seed(100)
@@ -205,6 +206,7 @@ def test_conv_crop_bn_relu_to_conv_bn_relu_crop(self):
205206
np.testing.assert_equal('crop', spec.layers[3].WhichOneof('layer'))
206207

207208

209+
@unittest.skipIf(platform != 'darwin' or macos_version() < (10, 15), "Requires MacOS 10.15 or later")
208210
class Redundant_Transposees_Test(unittest.TestCase):
209211

210212
def _test_builder(self, builder, input_shape, expected_layer_num=None):
@@ -230,7 +232,6 @@ def _test_builder(self, builder, input_shape, expected_layer_num=None):
230232

231233
np.testing.assert_almost_equal(output_before, output_after, decimal=3)
232234

233-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
234235
def test_output_edge_case(self):
235236

236237
# For now for safety purpose, the node which are output should't be merged
@@ -249,7 +250,6 @@ def test_output_edge_case(self):
249250

250251
self._test_builder(builder, input_shape, 2)
251252

252-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
253253
def test_output_edge_case_2(self):
254254

255255
# For now for safety purpose, the node which are output should't be merged
@@ -264,7 +264,6 @@ def test_output_edge_case_2(self):
264264

265265
self._test_builder(builder, input_shape, 1)
266266

267-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
268267
def test_remove_single_identity_transpose(self):
269268

270269
# A single identity transpose (like 0,1,2) should also be removed
@@ -283,7 +282,6 @@ def test_remove_single_identity_transpose(self):
283282

284283
self._test_builder(builder, input_shape, 1)
285284

286-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
287285
def test_remove_three_transpose(self):
288286

289287
# Three transpose layer which can be removed
@@ -309,7 +307,6 @@ def test_remove_three_transpose(self):
309307

310308
self._test_builder(builder, input_shape, 1)
311309

312-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
313310
def test_remove_thousands_identity_transpose(self):
314311

315312
'''
@@ -357,7 +354,6 @@ def test_remove_thousands_identity_transpose(self):
357354

358355
self._test_builder(builder, input_shape, 1)
359356

360-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
361357
def test_remove_thousands_identity_transpose_with_activation_between(self):
362358
'''
363359
INPUT
@@ -423,7 +419,6 @@ def test_remove_thousands_identity_transpose_with_activation_between(self):
423419
output_name='out')
424420
self._test_builder(builder, input_shape, 2)
425421

426-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
427422
def test_remove_thousands_random_transpose_layers(self):
428423
'''
429424
INPUT
@@ -487,7 +482,6 @@ def test_remove_thousands_random_transpose_layers(self):
487482
output_name='out')
488483
self._test_builder(builder, input_shape, None)
489484

490-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
491485
def test_remove_thousands_random_transpose_layers_case_2(self):
492486
'''
493487
Same test as the previous one, but add more layers and dimension.
@@ -519,7 +513,6 @@ def test_remove_thousands_random_transpose_layers_case_2(self):
519513
output_name='out')
520514
self._test_builder(builder, input_shape, None)
521515

522-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
523516
def test_branch_structure(self):
524517
'''
525518
INPUT
@@ -577,7 +570,6 @@ def test_branch_structure(self):
577570
output_name='dumpy')
578571
self._test_builder(builder, input_shape, 2)
579572

580-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
581573
def test_branch_case_2(self):
582574
'''
583575
INPUT
@@ -619,7 +611,6 @@ def test_branch_case_2(self):
619611
output_name='dumpy')
620612
self._test_builder(builder, input_shape, 4)
621613

622-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
623614
def test_fork_structure_case_3(self):
624615
'''
625616
INPUT
@@ -692,7 +683,6 @@ def test_fork_structure_case_3(self):
692683

693684
self._test_builder(builder, input_shape, 4)
694685

695-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
696686
def test_fork(self):
697687
'''
698688
INPUT
@@ -755,7 +745,6 @@ def test_fork(self):
755745
output_name='out_branch_2')
756746
self._test_builder(builder, input_shape, 2)
757747

758-
@unittest.skipIf(platform != 'darwin', "Requires MacOS")
759748
def test_fork_and_add(self):
760749
'''
761750
INPUT

coremltools/test/sklearn/test_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,7 @@ def test_pipeline_rename(self):
4444

4545
# Check the predictions
4646
if is_macos() and macos_version() >= (10, 13):
47-
self.assertAlmostEquals(model.predict({'input': sample_data}),
48-
renamed_model.predict({'renamed_input': sample_data}))
47+
out_dict = model.predict({'input': sample_data})
48+
out_dict_renamed = renamed_model.predict({'renamed_input': sample_data})
49+
self.assertAlmostEqual(list(out_dict.keys()), list(out_dict_renamed.keys()))
50+
self.assertAlmostEqual(list(out_dict.values()), list(out_dict_renamed.values()))

0 commit comments

Comments
 (0)