API reference

Core

class tensorstore.Context

Manages shared TensorStore context resources, such as caches and credentials.

class tensorstore.Transaction

Transactions are used to stage a group of modifications (e.g. writes to tensorstore.TensorStore objects) in memory, and then either commit the group all at once or abort it.

Indexing

tensorstore.newaxis = None

Alias for None used in indexing expressions to specify a new singleton dimension.

tensorstore.inf : int = 4611686018427387903

Special constant equal to \(2^{62}-1\) that indicates an unbounded index domain.

class tensorstore.Indexable

Abstract base class for types that support TensorStore indexing operations.

Spec

Views

tensorstore.downsample(base: TensorStore, )TensorStore

Returns a virtual downsampled view of a TensorStore.

tensorstore.downsample(base: Spec, downsample_factors, )Spec

Returns a virtual downsampled view view of a Spec.

Data types

class tensorstore.dtype

TensorStore data type representation.

tensorstore.bool : dtype = dtype("bool")

Boolean data type (0 or 1). Corresponds to the bool type and numpy.bool_.

tensorstore.int8 : dtype = dtype("int8")

8-bit signed two’s-complement integer data type. Corresponds to numpy.int8.

tensorstore.uint8 : dtype = dtype("uint8")

8-bit unsigned integer. Corresponds to numpy.uint8.

tensorstore.int16 : dtype = dtype("int16")

16-bit signed two’s-complement integer data type. Corresponds to numpy.int16.

tensorstore.uint16 : dtype = dtype("uint16")

16-bit unsigned integer. Corresponds to numpy.uint16.

tensorstore.int32 : dtype = dtype("int32")

32-bit signed two’s-complement integer data type. Corresponds to numpy.int32.

tensorstore.uint32 : dtype = dtype("uint32")

32-bit unsigned integer. Corresponds to numpy.uint32.

tensorstore.int64 : dtype = dtype("int64")

32-bit signed two’s-complement integer data type. Corresponds to numpy.int64.

tensorstore.uint64 : dtype = dtype("uint64")

64-bit unsigned integer data type. Corresponds to numpy.uint64.

tensorstore.float16 : dtype = dtype("float16")

IEEE 754 binary16 half-precision floating-point data type. Correspond to numpy.float16.

tensorstore.bfloat16 : dtype = dtype("bfloat16")

bfloat16 floating-point data type.

tensorstore.float32 : dtype = dtype("float32")

IEEE 754 binary32 single-precision floating-point data type. Corresponds to numpy.float32.

tensorstore.float64 : dtype = dtype("float64")

IEEE 754 binary64 double-precision floating-point data type. Corresponds to numpy.float64.

tensorstore.complex64 : dtype = dtype("complex64")

Complex number based on float32. Corresponds to numpy.complex64.

tensorstore.complex128 : dtype = dtype("complex128")

Complex number based on float64. Corresponds to numpy.complex128.

tensorstore.string : dtype = dtype("string")

Variable-length byte string data type. Corresponds to the Python bytes type.

tensorstore.ustring : dtype = dtype("ustring")

Variable-length Unicode string data type. Corresponds to the Python str type.

tensorstore.json : dtype = dtype("json")

JSON data type. Corresponds to an arbitrary Python JSON value.

Asynchronous support

class tensorstore.Future

Handle for consuming the result of an asynchronous operation.

class tensorstore.Promise

Handle for producing the result of an asynchronous operation.

class tensorstore.WriteFutures

Handle for consuming the result of an asynchronous write operation.

Classes

class tensorstore.d

Specifies a dimension selection, a sequence of index space dimensions.

class tensorstore.DimExpression
class tensorstore.Index

Array index

class tensorstore.IndexInterval

Represents an interval of index values, with support for +/-inf bounds.

class tensorstore.OutputIndexMethod

Members:

class tensorstore.OutputIndexMap

Represents an output index map for an index transform.

class tensorstore.OutputIndexMaps

View of the output index maps for an index transform.

class tensorstore.Dim

Index interval with optionally-implicit bounds and dimension label.

class tensorstore.IndexDomain

Specifies bounds and dimension labels of an N-dimensional index space.

class tensorstore.IndexTransform

Represents a transform between two index spaces.

class tensorstore.ChunkLayout
class tensorstore.Spec

Specification for opening or creating a TensorStore.

class tensorstore.TensorStore

Public members

tensorstore.cast(store: TensorStore, dtype: dtype)TensorStore

Returns a read/write TensorStore view as the specified data type.

tensorstore.array(array: array_like, )TensorStore

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

tensorstore.array(array: array_like, dtype, )TensorStore

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

tensorstore.open(spec: Spec, *, )Future[TensorStore]

Opens a TensorStore