Skip to content

Commit

Permalink
Add a test'
Browse files Browse the repository at this point in the history
  • Loading branch information
sushanthr committed Jul 9, 2023
1 parent 0855f89 commit a0afc8f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/node_converters/depth_to_space_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from typing import List

import numpy as np
import onnx

from tests.utils.common import check_onnx_model
from tests.utils.common import make_model_from_nodes


def _test_depth_to_space(
input_shape: List[int],
**kwargs,
) -> None:
x = np.random.uniform(low=-1.0, high=1.0, size=input_shape).astype(np.float32)
test_inputs = {'x': x}

node = onnx.helper.make_node(
op_type='DepthToSpace',
inputs=['x'],
outputs=['y'],
**kwargs,
)
model = make_model_from_nodes(nodes=node, initializers={}, inputs_example=test_inputs, opset_version=13)
check_onnx_model(model, test_inputs)


def test_depth_to_space() -> None: # pylint: disable=missing-function-docstring
_test_depth_to_space(input_shape=[1, 12, 3, 3], blocksize=2, mode='CRD')

0 comments on commit a0afc8f

Please sign in to comment.