cast
Driver¶
Virtual read/write view that performs element-wise data type conversion.
Reading is supported if the
base
TensorStore supports reading and conversion from the base data type to the view data type is supported.Writing is supported if the
base
TensorStore supports writing and conversion from the view data type to the base data type is supported.
The top-level transform
, if any, is composed
with the TensorStore.transform
, if any, specified on
base
.
- json driver/cast : object¶
- Extends:¶
TensorStoreAdapter
— Specifies a TensorStore that adapts a base TensorStore.
- Required members:¶
-
driver :
"cast"
¶
- base : TensorStore | KvStore | TensorStoreUrl¶
Base TensorStore to adapt.
If a
KvStore
orKvStoreUrl
is specified, the auto driver is used implicitly to auto-detect the format.
-
driver :
- Optional members:¶
-
-
rank : integer[
0
,32
]¶ Specifies the rank of the TensorStore.
If
transform
is also specified, the input rank must match. Otherwise, the rank constraint applies to the driver directly.
- transform : IndexTransform¶
Specifies a transform.
- schema : Schema¶
Specifies constraints on the schema.
When opening an existing array, specifies constraints on the existing schema; opening will fail if the constraints do not match. Any soft constraints specified in the
chunk_layout
are ignored. When creating a new array, a suitable schema will be selected automatically based on the specified schema constraints in combination with any driver-specific constraints.
-
rank : integer[
Example
{ "driver": "cast", "dtype": "int32", "base": {"driver": "zarr", "kvstore": {"driver": "gcs", "bucket": "my-bucket"}} }
- json TensorStoreUrl/cast : string¶
cast:
TensorStore URL schemeData type conversion may be specified using the
cast:dtype
URL syntax.Examples
URL representation
JSON representation
"file:///tmp/dataset.zarr/|zarr3:|cast:uint32"
{"driver": "cast", "dtype": "uint32", "base": {"driver": "zarr3", "kvstore": {"driver": "file", "path": "/tmp/dataset.zarr/"}} }
- Extends:¶
TensorStoreUrl
— URL representation of a TensorStore to open.