File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,22 @@ def identity(arr):
141141 assert result .dtype == np .uint8
142142 assert result .shape == arr .shape
143143
144+ def test_numpy_decorator_tuple_dtype_conversion (self ):
145+ """Test tuple output dtype conversion applies to main output only."""
146+ from arraybridge .decorators import numpy
147+
148+ @numpy
149+ def to_float_with_meta (arr ):
150+ return arr .astype (np .float32 ), {"meta" : "ok" }
151+
152+ arr = np .array ([0 , 127 , 255 ], dtype = np .uint8 )
153+ result = to_float_with_meta (arr )
154+
155+ assert isinstance (result , tuple )
156+ assert result [0 ].dtype == np .uint8
157+ assert result [0 ].shape == arr .shape
158+ assert result [1 ]["meta" ] == "ok"
159+
144160 def test_cupy_decorator_exists (self ):
145161 """Test that cupy decorator is available."""
146162 from arraybridge .decorators import cupy
You can’t perform that action at this time.
0 commit comments