powered by
Flatten
torch_flatten(self, dims, start_dim = 1L, end_dim = -1L, out_dim)
(Tensor) the input tensor.
if tensor is named you can pass the name of the dimensions to flatten
(int) the first dim to flatten
(int) the last dim to flatten
the name of the resulting dimension if a named tensor.
Flattens a contiguous range of dims in a tensor.
if (torch_is_installed()) { t = torch_tensor(matrix(c(1, 2), ncol = 2)) torch_flatten(t) torch_flatten(t, start_dim=2) }
Run the code above in your browser using DataLab