torch_cartesian_prod: Cartesian_prod

Description Usage Arguments Examples

View source: R/gen-namespace.R

Description

Do cartesian product of the given sequence of tensors.

Usage

1

Arguments

tensors

a list containing any number of 1 dimensional tensors.

Examples

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

a = c(1, 2, 3)
b = c(4, 5)
tensor_a = torch_tensor(a)
tensor_b = torch_tensor(b)
torch_cartesian_prod(list(tensor_a, tensor_b))
}

Example output



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