as.Tensor: Converts an array to an S3 tensor

as.TensorR Documentation

Converts an array to an S3 tensor

Description

This will converts array to S3 object tensor. Vectors and matrices must first be converted to an array before applying as.Tensor.

Usage

as.Tensor(t)

Arguments

t

Numeric, array of numbers

Value

S3 class tensor

Author(s)

Kyle Caudle

Randy Hoover

Jackson Cates

Everett Sandbo

Examples

indices <- c(2,3,4)
arr <- array(runif(prod(indices)), dim = indices)
arrT <- as.Tensor(arr); arrT

TensorTools documentation built on Oct. 18, 2024, 1:07 a.m.