def test_tiny_permute(self):
model = Sequential()
model.add(Permute((3, 2, 1), input_shape=(4, 3, 2)))
# When input blob is 3D array (D1, D2, D3), Keras assumes the axes' meaning is
# (D1=H,D2=W,D3=C), while CoreML assumes (D1=C,D2=H,D3=W). However,
# it's unclear after permutation, what the axes' meaning is for the output blob.
# Since permutation done on (H,W,C) blobs usually is usually followed by
# recurrent layers / Dense, we choose that the ouput axis order of CoreML is
# the same as Keras after permutation.
self._test_keras_model(model, transpose_keras_result=False)
评论列表
文章目录