torch_outer: Outer

Description Usage Arguments outer(input, vec2, *, out=None) -> Tensor Note Examples

View source: R/gen-namespace.R

Description

Outer

Usage

1
torch_outer(self, vec2)

Arguments

self

(Tensor) 1-D input vector

vec2

(Tensor) 1-D input vector

outer(input, vec2, *, out=None) -> Tensor

Outer product of input and vec2. If input is a vector of size n and vec2 is a vector of size m, then out must be a matrix of size (n \times m).

Note

This function does not broadcast.

Examples

1
2
3
4
5
6
if (torch_is_installed()) {

v1 <- torch_arange(1., 5.)
v2 <- torch_arange(1., 4.)
torch_outer(v1, v2)
}

torch documentation built on Oct. 7, 2021, 9:22 a.m.