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

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

### Hierarchy

- TypedTensorBase< Type >
- TypedTensorUtils< Type >
  - Tensor

## Index

### Properties

- data
- dims
- size
- type

### Methods

- reshape

## Properties

### Readonly data

data: Uint8Array | string[] | Float32Array | Int8Array | Uint16Array | Int16Array | Int32Array | BigInt64Array | Float64Array | Uint32Array | BigUint64Array

Inherited from TypedTensorBase.data

- Defined in tensor.ts:24

Get the buffer data of the tensor.

### Readonly dims

dims: readonly number[]

Inherited from TypedTensorBase.dims

- Defined in tensor.ts:16

Get the dimensions of the tensor.

### Readonly size

size: number

Inherited from TypedTensorUtils.size

- Defined in tensor-utils.ts:10

Get the number of elements in the tensor.

### Readonly type

type: keyof DataTypeMap

Inherited from TypedTensorBase.type

- Defined in tensor.ts:20

Get the data type of the tensor.

## Methods

### reshape

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

- Inherited from TypedTensorUtils.reshape

  - Defined in tensor-utils.ts:19

  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 <keyof DataTypeMap >

Generated using TypeDoc