test_keras2_numeric.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:coremltools 作者: apple 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号