Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/netsaur/src/core/tensor/tensor.ts>Tensor

Powerful machine learning, accelerated by WebGPU
Go to Latest
class Tensor
import { Tensor } from "https://deno.land/x/netsaur@0.2.0/src/core/tensor/tensor.ts";

A generic N-dimensional tensor.

Constructors

new
Tensor(data: TensorData[B], shape: Shape[R])

Type Parameters

R extends Rank
B extends BackendType

Methods

get()

Get tensor data as an array of values.

set(values: Float32Array)

Set tensor data from an array of values.

Serialise a tensor into JSON.

Static Methods

from<R extends Rank, B extends BackendType>(values: Float32Array, shape: Shape[R]): Tensor<R, B>

Creates a tensor from an array of values.

Deserialise a tensor from JSON.

zeroes<R extends Rank, B extends BackendType>(shape: Shape[R]): Tensor<R, B>

Creates an empty tensor.