47 lines
2.4 KiB
C
47 lines
2.4 KiB
C
#ifndef MYSTERY_H
|
|
#define MYSTERY_H
|
|
|
|
//====================================================================================
|
|
//++++ To use mystery node, user needs to
|
|
//++++ 1. provide function definition(which aligns with Mystery_fn)/implementation for each node
|
|
//++++ 2. implement build_mystery_fn
|
|
|
|
//============== Below define an interface and should not be changed by user===========
|
|
struct DimensionInfo {
|
|
int num;
|
|
int* shape_sizes;
|
|
int** shapes;
|
|
int* types;
|
|
};
|
|
|
|
typedef void (*Mystery_fn)(const void* const* inputs, const int* const* input_shapes, const int* input_shape_sizes, int* input_data_types, int input_num,
|
|
char** attr_names, int* attr_types, int* attr_sizes, void** attr_values, const int attr_num, void** outputs, const int* const* output_shapes, const int* output_shape_sizes, int* output_data_types, int output_num);
|
|
|
|
struct MysteryFuMap {
|
|
const char* op_type;
|
|
Mystery_fn Mystery_fn;
|
|
};
|
|
|
|
void build_mystery_fn(struct MysteryFuMap mystery_fns[]) ;
|
|
|
|
void get_output_shape(const int** input_shapes, const int* input_shape_sizes, const int* input_data_types, int input_num, char** attr_names, int* attr_types, int* attr_sizes, void** attr_values, const int attr_num, struct DimensionInfo* out_info);
|
|
|
|
void custom_shape(const int** input_shapes, const int* input_shape_sizes, const int* input_data_types, int input_num, char** attr_names, int* attr_types, int* attr_sizes, void** attr_values, const int attr_num, struct DimensionInfo* out_info);
|
|
|
|
//===================== Below is example only and can be updated=======================
|
|
// This example demonstrates how to use 1 mystery node
|
|
|
|
|
|
void cumtom_op(const void* const* inputs, const int* const* input_shapes, const int* input_shape_sizes, int* input_data_types, int input_num,
|
|
char** attr_names, int* attr_types, int* attr_sizes, void** attr_values, const int attr_num, void** outputs, const int* const* output_shapes, const int* output_shape_sizes, int* output_data_types, int output_num);
|
|
|
|
void bev_pool_v2(const void* const* inputs, const int* const* input_shapes, const int* input_shape_sizes, int* input_data_types, int input_num,
|
|
char** attr_names, int* attr_types, int* attr_sizes, void** attr_values, const int attr_num, void** outputs, const int* const* output_shapes, const int* output_shape_sizes, int* output_data_types, int output_num);
|
|
|
|
|
|
enum map_id_op {
|
|
mystery_op_total = 2,
|
|
};
|
|
|
|
#endif
|