1 /** 2 * Copyright 2020 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef NNACL_TRANSPOSE_PARAMETER_H_ 18 #define NNACL_TRANSPOSE_PARAMETER_H_ 19 20 #include "nnacl/op_base.h" 21 22 // MAX_TRANSPOSE_SERIAL_SIZE = 64 * 3 * 512 * 512 23 #define MAX_TRANSPOSE_SERIAL_SIZE 50331648 24 #define MAX_TRANSPOSE_DIM_SIZE 20 25 #define PERM_NUM_THREE 3 26 #define PERM_NUM_FOUR 4 27 28 typedef struct TransposeParameter { 29 // primitive parameter 30 OpParameter op_parameter_; 31 int perm_[MAX_TRANSPOSE_DIM_SIZE]; 32 size_t perm_size_; 33 bool conjugate_; 34 35 // shape correlative 36 int strides_[MAX_TRANSPOSE_DIM_SIZE]; 37 int out_strides_[MAX_TRANSPOSE_DIM_SIZE]; 38 39 // other parameter 40 int num_axes_; 41 int data_num_; 42 } TransposeParameter; 43 44 #endif // NNACL_TRANSPOSE_PARAMETER_H_ 45