# tensorplay.functional.take Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.take.html ```python tensorplay.functional.take(input, index) → Tensor ``` Returns a new tensor with the elements of 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. Parameters: - input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. - index (LongTensor) – the indices into tensor Example: ``` >>> src = tensorplay.tensor([[4, 3, 5], ... [6, 7, 8]]) >>> tensorplay.take(src, tensorplay.tensor([0, 2, 5])) tensor([ 4, 5, 8]) ```