Interface TensorConstructor

Hierarchy

  • TensorConstructor

Constructors

Constructors

  • Construct a new string tensor object from the given type, data and dims.

    Parameters

    • type: "string"

      Specify the element type.

    • data: string[] | readonly string[]

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"string">

  • Construct a new bool tensor object from the given type, data and dims.

    Parameters

    • type: "bool"

      Specify the element type.

    • data: Uint8Array | readonly boolean[]

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"bool">

  • Construct a new numeric tensor object from the given type, data and dims.

    Type Parameters

    • T extends "float32" | "uint8" | "int8" | "uint16" | "int16" | "int32" | "int64" | "float16" | "float64" | "uint32" | "uint64"

    Parameters

    • type: T

      Specify the element type.

    • data: readonly number[] | DataTypeMap[T]

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<T>

  • Construct a new float32 tensor object from the given data and dims.

    Parameters

    • data: Float32Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"float32">

  • Construct a new int8 tensor object from the given data and dims.

    Parameters

    • data: Int8Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"int8">

  • Construct a new uint8 tensor object from the given data and dims.

    Parameters

    • data: Uint8Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"uint8">

  • Construct a new uint16 tensor object from the given data and dims.

    Parameters

    • data: Uint16Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"uint16">

  • Construct a new int16 tensor object from the given data and dims.

    Parameters

    • data: Int16Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"int16">

  • Construct a new int32 tensor object from the given data and dims.

    Parameters

    • data: Int32Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"int32">

  • Construct a new int64 tensor object from the given data and dims.

    Parameters

    • data: BigInt64Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"int64">

  • Construct a new string tensor object from the given data and dims.

    Parameters

    • data: readonly string[]

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"string">

  • Construct a new bool tensor object from the given data and dims.

    Parameters

    • data: readonly boolean[]

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"bool">

  • Construct a new float64 tensor object from the given data and dims.

    Parameters

    • data: Float64Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"float64">

  • Construct a new uint32 tensor object from the given data and dims.

    Parameters

    • data: Uint32Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"uint32">

  • Construct a new uint64 tensor object from the given data and dims.

    Parameters

    • data: BigUint64Array

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns TypedTensor<"uint64">

  • Construct a new tensor object from the given type, data and dims.

    Parameters

    • type: keyof DataTypeMap

      Specify the element type.

    • data: readonly number[] | DataType | readonly boolean[]

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns Tensor

  • Construct a new tensor object from the given data and dims.

    Parameters

    • data: DataType

      Specify the tensor data

    • Optional dims: readonly number[]

      Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.

    Returns Tensor

Generated using TypeDoc