ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
A functor to perform stride operation on a Tensor. More...
#include <linalg_op.h>
Public Member Functions | |
void | operator() (const Tensor &input, const std::vector< int64_t > &stride, Tensor &output) |
Perform stride operation on the input Tensor. | |
A functor to perform stride operation on a Tensor.
This functor applies a stride operation on the input Tensor, resulting in a new Tensor with data elements selected based on the specified stride. The stride specifies how elements are skipped in each dimension during the selection process.
T | The data type of the Tensor. |
Device | The execution device (e.g., CPU or GPU). |
void container::op::stride_op::operator() | ( | const Tensor & | input, |
const std::vector< int64_t > & | stride, | ||
Tensor & | output | ||
) |
Perform stride operation on the input Tensor.
This function applies the stride operation on the input Tensor, generating a new Tensor with data elements selected based on the specified stride.
input | The input Tensor on which the stride operation is performed. |
stride | The stride specification, represented as a TensorShape. The stride specifies how elements are skipped in each dimension during the selection process. |
output | The output Tensor that will hold the result of the stride operation. It must have the appropriate size to store the selected elements. |