2026-01-28 06:16:04 +00:00

101 lines
3.4 KiB
C

//
// Created by xiangzhou on 11/9/23.
//
#pragma once
#include "C_Tensor.h"
#ifdef __cplusplus
extern "C" {
#endif
//----------------------------------------------------------------------------
// KneronChannelShuffle
//------------------------------------------------------------------------
struct KneronChannelShuffleAttribute {
// user
const char* name_;
int group_;
const char *mode_;
};
typedef struct KneronChannelShuffleAttribute KneronChannelShuffleAttribute;
//----------------------------------------------------------------------------
// KneronChannelSplit
//------------------------------------------------------------------------
struct KneronChannelSplitAttribute {
// user
const char* name_;
const char *mode_;
};
typedef struct KneronChannelSplitAttribute KneronChannelSplitAttribute;
//----------------------------------------------------------------------------
// KneronDownSample
//------------------------------------------------------------------------
struct KneronDownSampleAttribute {
// user
const char* name_;
uint32_t top_pad_;
uint32_t bottom_pad_;
uint32_t left_pad_;
uint32_t right_pad_;
uint32_t stride_h_;
uint32_t stride_w_;
int32_t offsets_[2];
};
typedef struct KneronDownSampleAttribute KneronDownSampleAttribute;
//----------------------------------------------------------------------------
// KneronMaxRoiPool
//------------------------------------------------------------------------
struct KneronMaxRoiPoolAttribute {
// user
const char* name_;
float spatial_scale_;
int32_t roi_[4]; // this is just one roi, Don't support multiple roi yet
int32_t roi_kernel_[2];
};
typedef struct KneronMaxRoiPoolAttribute KneronMaxRoiPoolAttribute;
//----------------------------------------------------------------------------
// KneronRoll
//------------------------------------------------------------------------
struct KneronRollAttribute {
// user
const char* name_;
C_Shape axes_;
C_Shape shifts_;
};
typedef struct KneronRollAttribute KneronRollAttribute;
//----------------------------------------------------------------------------
// KneronSpaceToDepth
//------------------------------------------------------------------------
struct KneronSpaceToDepthAttribute {
// user
const char* name_;
int blocksize_;
const char *mode_;
};
typedef struct KneronSpaceToDepthAttribute KneronSpaceToDepthAttribute;
//----------------------------------------------------------------------------
// KneronUpsampleZeroFill
//------------------------------------------------------------------------
struct KneronUpsampleZeroFillAttribute {
// user
const char* name_;
int upsample_scale_[2];
};
typedef struct KneronUpsampleZeroFillAttribute KneronUpsampleZeroFillAttribute;
//----------------------------------------------------------------------------
// KneronInvsqrt
//------------------------------------------------------------------------
typedef struct Attribute KneronInvsqrtAttribute;
CREATE_DECL_RUN_FUN(KneronChannelShuffle)
CREATE_DECL_RUN_FUN(KneronChannelSplit)
CREATE_DECL_RUN_FUN(KneronDownSample)
CREATE_DECL_RUN_FUN(KneronInvsqrt)
CREATE_DECL_RUN_FUN(KneronMaxRoiPool)
CREATE_DECL_RUN_FUN(KneronRoll)
CREATE_DECL_RUN_FUN(KneronSpaceToDepth)
CREATE_DECL_RUN_FUN(KneronUpsampleZeroFill)
#ifdef __cplusplus
}
#endif