ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | List of all members
container::op::stride_op Struct Reference

A functor to perform stride operation on a Tensor. More...

#include <linalg_op.h>

Collaboration diagram for container::op::stride_op:

Public Member Functions

void operator() (const Tensor &input, const std::vector< int64_t > &stride, Tensor &output)
 Perform stride operation on the input Tensor.
 

Detailed Description

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.

Template Parameters
TThe data type of the Tensor.
DeviceThe execution device (e.g., CPU or GPU).

Member Function Documentation

◆ operator()()

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.

Parameters
inputThe input Tensor on which the stride operation is performed.
strideThe stride specification, represented as a TensorShape. The stride specifies how elements are skipped in each dimension during the selection process.
outputThe output Tensor that will hold the result of the stride operation. It must have the appropriate size to store the selected elements.
Here is the call graph for this function:

The documentation for this struct was generated from the following files: