# TypedTensor | ONNX Runtime JavaScript API
Documentation for ONNX Runtime JavaScript API

# Interface TypedTensor<T>

Represent multi-dimensional arrays to feed to or fetch from model inferencing.

#### Type Parameters

- #### T extends Type

#### Hierarchy

- TypedTensorBase<T>
- TypedTensorUtils<T>
  - TypedTensor

- Defined in tensor.ts:78

#####
Index

### Properties

data
dims
size
type

### Methods

reshape
toImageData

## Properties

### `Readonly` data

data: DataTypeMap [T]

Get the buffer data of the tensor.

Inherited from TypedTensorBase.data

- Defined in tensor.ts:24

### `Readonly` dims

dims: readonly number[]

Get the dimensions of the tensor.

Inherited from TypedTensorBase.dims

- Defined in tensor.ts:16

### `Readonly` size

size: number

Get the number of elements in the tensor.

Inherited from TypedTensorUtils.size

- Defined in tensor-utils.ts:10

### `Readonly` type

type: T

Get the data type of the tensor.

Inherited from TypedTensorBase.type

- Defined in tensor.ts:20

## Methods

### reshape

- reshape(dims: readonly number[]): TypedTensor <T>

- Create a new tensor with the same data buffer and specified dims.

  #### Parameters

  - ##### dims: readonly number[]

    New dimensions. Size should match the old one.

  #### Returns TypedTensor <T>

  Inherited from TypedTensorUtils.reshape

  - Defined in tensor-utils.ts:19

### toImageData

- toImageData(options?: TensorToImageDataOptions ): ImageData

- creates an ImageData instance from tensor

  ### Returns

  An ImageData instance which can be used to draw on canvas

  #### Parameters

  - ##### `Optional` options: TensorToImageDataOptions

  #### Returns ImageData

  Inherited from TypedTensorUtils.toImageData

  - Defined in tensor-utils.ts:31

Generated using TypeDoc