---
title: TensorModel (latest version)
description: API reference for ibm_quantum_schemas.common.TensorModel in the latest version of qiskit-ibm-runtime
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit-ibm-runtime/ibm-quantum-schemas-common-tensor-model
---

# TensorModel

*pydantic model* `TensorModel`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/tensor.py#L50-L125)

Bases: `BaseModel`

Model of tensor data.

### data

*field*

Type: `str`

Base-64-encoded data in litte endian format.

Bool arrays are bitpacked, other types are IEEE753. Everything is little-endian. Tensors are C-ordering.

**Validated by**

- `check_sizes`

### dtype

*field*

Type: `Literal`\[`'f64'`, `'bool'`, `'u8'`, `'c128'`]

The data type of the tensor.

**Validated by**

- `check_sizes`

### shape

*field*

Type: `list`\[`int`]

The shape of the tensor.

**Validated by**

- `check_sizes`

### check\_sizes

*validator* `check_sizes`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/tensor.py#L111-L125)

Cross-validate that all sizes are consistent.

### from\_numpy

*classmethod* `from_numpy(array)`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/tensor.py#L68-L90)

Instantiate from a NumPy array.

**Parameters**

**array** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray))

### to\_numpy

`to_numpy()`

[GitHub](https://github.com/Qiskit/ibm-quantum-schemas/tree/0.10.20260723/ibm_quantum_schemas/common/tensor.py#L92-L109)

Convert to a NumPy Array.

**Return type**

[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)
