2022-09-29 10:29:24 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
const int MAX_DIM = 4;
|
|
|
|
|
|
|
|
// Pad operator acts like padding small(part) tensor into a big(whole) tensor.
|
|
|
|
// Slice operator acts like spling a big(whole) tensor into a small(part)
|
|
|
|
// tensor.
|
|
|
|
typedef struct {
|
|
|
|
int begNum[MAX_DIM]; // pad or slice number at beginning
|
|
|
|
int wholeNDim[MAX_DIM]; // dim size after padding or before slicing
|
|
|
|
int partNDim[MAX_DIM]; // dim size before padding or after slicing
|
|
|
|
int partStride[MAX_DIM]; // stride before padding or after slicing
|
2023-11-23 13:11:50 +08:00
|
|
|
int DType;
|
2022-09-29 10:29:24 +08:00
|
|
|
} TransMetaData;
|
|
|
|
|
|
|
|
namespace infini {
|
2023-11-23 13:11:50 +08:00
|
|
|
void pad_slice_kernel(void *partData, void *wholeData,
|
2022-09-29 10:29:24 +08:00
|
|
|
const TransMetaData &metadata, int nDims, int num,
|
|
|
|
bool isPad);
|
2022-10-15 16:29:28 +08:00
|
|
|
} // namespace infini
|