tensorstore.array(array: ArrayLike, dtype: dtype | None = None, *, context: Context = None, copy: bool | None = None, write: bool | None = None) TensorStore

Returns a TensorStore that reads/writes from an in-memory array.

Parameters:
array: ArrayLike

Source array.

dtype: dtype | None = None

Data type to which array will be converted.

context: Context = None

Optional context to use, for specifying Context.data_copy_concurrency.

copy: bool | None = None

Indicates whether the returned TensorStore may be a copy of the source array, rather than a reference to it.

  • If None (default), the source array is copied only if it cannot be referenced.

  • If True, a copy is always made.

  • If False, a copy is never made and an error is raised if the source data can’t be referenced.

write: bool | None = None

Indicates whether the returned TensorStore is writable.

  • If None (default), the returned TensorStore may or may not be writable, depending on whether the source array converts to a writable NumPy array.

  • If True, the returned TensorStore is required to be writable, and an error is returned if the source array does not support writing.

  • If False, the returned TensorStore is never writable, even if the source array is writable.