View source: R/gen-namespace.R
torch_cross | R Documentation |
Cross
torch_cross(self, other, dim = NULL)
self |
(Tensor) the input tensor. |
other |
(Tensor) the second input tensor |
dim |
(int, optional) the dimension to take the cross-product in. |
Returns the cross product of vectors in dimension dim
of input
and other
.
input
and other
must have the same size, and the size of their
dim
dimension should be 3.
If dim
is not given, it defaults to the first dimension found with the
size 3.
if (torch_is_installed()) {
a = torch_randn(c(4, 3))
a
b = torch_randn(c(4, 3))
b
torch_cross(a, b, dim=2)
torch_cross(a, b)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.