MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / test_op_resize

Function test_op_resize

tests/cvcuda/python/test_opresize.py:47–85  ·  view source on GitHub ↗
(input_args, out_shape, interp)

Source from the content-addressed store, hash-verified

45 ],
46)
47def test_op_resize(input_args, out_shape, interp):
48 input = cvcuda.Tensor(*input_args)
49
50 if interp is None:
51 out = cvcuda.resize(input, out_shape)
52 else:
53 out = cvcuda.resize(input, out_shape, interp)
54 assert out.layout == input.layout
55 assert out.shape == out_shape
56 assert out.dtype == input.dtype
57
58 out = cvcuda.Tensor(out_shape, input.dtype, input.layout)
59 if interp is None:
60 tmp = cvcuda.resize_into(out, input)
61 else:
62 tmp = cvcuda.resize_into(out, input, interp)
63 assert tmp is out
64 assert out.layout == input.layout
65 assert out.shape == out_shape
66 assert out.dtype == input.dtype
67
68 stream = cvcuda.Stream()
69 if interp is None:
70 out = cvcuda.resize(src=input, shape=out_shape, stream=stream)
71 else:
72 out = cvcuda.resize(src=input, shape=out_shape, interp=interp, stream=stream)
73 stream.sync()
74 assert out.layout == input.layout
75 assert out.shape == out_shape
76 assert out.dtype == input.dtype
77
78 if interp is None:
79 tmp = cvcuda.resize_into(src=input, dst=out, stream=stream)
80 else:
81 tmp = cvcuda.resize_into(src=input, dst=out, interp=interp, stream=stream)
82 assert tmp is out
83 assert out.layout == input.layout
84 assert out.shape == out_shape
85 assert out.dtype == input.dtype
86
87
88@t.mark.parametrize(

Callers

nothing calls this directly

Calls 4

syncMethod · 0.95
TensorMethod · 0.45
resizeMethod · 0.45
StreamMethod · 0.45

Tested by

no test coverage detected