Esempio n. 1
0
    def export_inverse_batched():  # type: () -> None
        node = onnx.helper.make_node('Inverse', inputs=['x'], outputs=['y'])

        X = np.random.randn(2, 3, 4, 4)
        Y = inverse_reference_implementation(X)

        expect(node, inputs=[X], outputs=[Y], name='test_inverse_batched')
Esempio n. 2
0
    def export_squeeze():  # type: () -> None
        node = onnx.helper.make_node(
            'Squeeze',
            inputs=['x', 'axes'],
            outputs=['y'],
        )
        x = np.random.randn(1, 3, 4, 5).astype(np.float32)
        axes = np.array([0], dtype=np.int64)
        y = np.squeeze(x, axis=0)

        expect(node, inputs=[x, axes], outputs=[y], name='test_squeeze')
Esempio n. 3
0
 def export_squeeze_negative_axes() -> None:
     node = onnx.helper.make_node(
         'Squeeze',
         inputs=['x', 'axes'],
         outputs=['y'],
     )
     x = np.random.randn(1, 3, 1, 5).astype(np.float32)
     axes = np.array([-2], dtype=np.int64)
     y = np.squeeze(x, axis=-2)
     expect(node, inputs=[x, axes], outputs=[y],
            name='test_squeeze_negative_axes')
Esempio n. 4
0
 def export_squeeze_negative_axes():  # type: () -> None
     node = onnx.helper.make_node(
         'Squeeze',
         inputs=['x'],
         outputs=['y'],
         axes=[-2],
     )
     x = np.random.randn(1, 3, 1, 5).astype(np.float32)
     y = np.squeeze(x, axis=-2)
     expect(node,
            inputs=[x],
            outputs=[y],
            name='test_squeeze_negative_axes')