% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gen-namespace-docs.R,
%   R/gen-namespace-examples.R, R/gen-namespace.R
\name{torch_take}
\alias{torch_take}
\title{Take}
\usage{
torch_take(self, index)
}
\arguments{
\item{self}{(Tensor) the input tensor.}

\item{index}{(LongTensor) the indices into tensor}
}
\description{
Take
}
\section{take(input, index) -> Tensor }{


Returns a new tensor with the elements of \code{input} at the given indices.
The input tensor is treated as if it were viewed as a 1-D tensor. The result
takes the same shape as the indices.
}

\examples{
if (torch_is_installed()) {

src = torch_tensor(matrix(c(4,3,5,6,7,8), ncol = 3, byrow = TRUE))
torch_take(src, torch_tensor(c(1, 2, 5), dtype = torch_int64()))
}
}
