View source: R/gen-namespace.R
torch_trapz | R Documentation |
Trapz
torch_trapz(y, dx = 1L, x, dim = -1L)
y |
(Tensor) The values of the function to integrate |
dx |
(float) The distance between points at which |
x |
(Tensor) The points at which the function |
dim |
(int) The dimension along which to integrate. By default, use the last dimension. |
Estimate \int y\,dx
along dim
, using the trapezoid rule.
As above, but the sample points are spaced uniformly at a distance of dx
.
if (torch_is_installed()) {
y = torch_randn(list(2, 3))
y
x = torch_tensor(matrix(c(1, 3, 4, 1, 2, 3), ncol = 3, byrow=TRUE))
torch_trapz(y, x = x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.