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
  • TensorStore — Specifies a TensorStore to open/create.

Required members:
driver : "cast"
dtype : dtype

Specifies the data type under which to view the base TensorStore.

base : TensorStore

Base TensorStore to convert.

Optional members:
context : Context

Specifies context resources that augment/override the parent context.

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.


  "driver": "cast",
  "dtype": "int32",
  "base": {"driver": "zarr", "kvstore": {"driver": "gcs", "bucket": "my-bucket"}}