MCPcopy
hub / github.com/huggingface/datasets / test_cast_array_to_features_array_xd

Function test_cast_array_to_features_array_xd

tests/test_table.py:1192–1199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1190
1191
1192def test_cast_array_to_features_array_xd():
1193 # same storage type
1194 arr = pa.array([[[0, 1], [2, 3]], [[4, 5], [6, 7]]], pa.list_(pa.list_(pa.int32(), 2), 2))
1195 casted_array = cast_array_to_feature(arr, Array2D(shape=(2, 2), dtype="int32"))
1196 assert casted_array.type == Array2DExtensionType(shape=(2, 2), dtype="int32")
1197 # different storage type
1198 casted_array = cast_array_to_feature(arr, Array2D(shape=(2, 2), dtype="float32"))
1199 assert casted_array.type == Array2DExtensionType(shape=(2, 2), dtype="float32")
1200
1201
1202def test_cast_array_to_features_sequence_classlabel():

Callers

nothing calls this directly

Calls 3

cast_array_to_featureFunction · 0.90
Array2DClass · 0.90

Tested by

no test coverage detected