Learn R Programming

TRES (version 0.1.0)

ttt: Inner product of tensor X and Y

Description

ttt(X,Y,dims) computes the inner product of tensors X and Y in the dimensions specified by the vector dims. The sizes of the dimensions specified by dims must match, which is size(X, dims) must equal size(Y, dims).

Usage

ttt(X, Y, dims)

Arguments

X

A tensor instance.

Y

A tensor instance.

dims

The indices of the modes to map onto the column space.

Value

mat

The inner product of tensors \(X\) and \(Y\) in the dimensions specified by the vector dims, which is a matrix.

Examples

Run this code
# NOT RUN {
 X = as.tensor(array(runif(24), c(3, 4, 2)));
 Y = as.tensor(array(runif(24), c(3, 4, 2)));
 Z = ttt(X, Y, 1:2)
# }

Run the code above in your browser using DataLab