Learn R Programming

TensorTools (version 1.0.0)

as.Tensor: 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)

Value

S3 class tensor

Arguments

t

Numeric, array of numbers

Author

Kyle Caudle

Randy Hoover

Jackson Cates

Everett Sandbo

Examples

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

Run the code above in your browser using DataLab