hl_matrix_stub.h 4.3 KB
Newer Older
Z
zhangjinchao01 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserve.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

#ifndef HL_MATRIX_STUB_H_
#define HL_MATRIX_STUB_H_

#include "hl_matrix.h"

inline void hl_matrix_add(real* A_d,
                          real* B_d,
                          real* C_d,
                          int dimM,
                          int dimN,
                          real alpha,
                          real beta) {}

28
inline void hl_matrix_softmax(real* A_d, real* C_d, int dimM, int dimN) {}
Z
zhangjinchao01 已提交
29

30 31
inline void hl_sequence_softmax_forward(real* A_d,
                                        real* C_d,
Z
zhangjinchao01 已提交
32 33 34
                                        const int* index,
                                        int numSequence) {}

35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
inline void hl_matrix_softmax_derivative(
    real* grad_d, real* output_d, real* sftmaxSum_d, int dimM, int dimN) {}

inline void hl_matrix_classification_error(
    real* A_d, int* B_d, real* C_d, int dimM, int dimN) {}

inline void hl_matrix_cross_entropy(
    real* A_d, real* C_d, int* label_d, int dimM, int dimN) {}

inline void hl_matrix_cross_entropy_bp(
    real* grad_d, real* output_d, int* label_d, int dimM, int dimN) {}

inline void hl_matrix_multi_binary_cross_entropy(
    real* output, real* entropy, hl_sparse_matrix_s mat, int dimM, int dimN) {}

inline void hl_matrix_multi_binary_cross_entropy_bp(
    real* output, real* grad, hl_sparse_matrix_s mat, int dimM, int dimN) {}
52

Z
zhangjinchao01 已提交
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
inline void hl_matrix_zero_mem(real* data, int num) {}

inline void hl_param_relu_forward(real* output,
                                  real* input,
                                  real* w,
                                  int width,
                                  int height,
                                  int partial_sum) {}

inline void hl_param_relu_backward_w(real* grad_w,
                                     real* grad_o,
                                     real* input,
                                     int width,
                                     int height,
                                     int partial_sum) {}

inline void hl_param_relu_backward_diff(real* grad_o,
                                        real* input,
                                        real* w,
                                        real* diff,
                                        int width,
                                        int height,
                                        int partial_sum) {}

inline void hl_cossim(real* output,
                      real* input1,
                      real* input2,
                      int width,
                      int input1_height,
                      int input2_height,
                      real scale) {}

inline void hl_cossim_derivative(real* grad,
                                 real* output,
                                 real* prevOutX,
                                 real* prevOutY,
                                 real* prevGradX,
                                 real* prevGradY,
                                 int width,
                                 int input1_height,
                                 int input2_height,
                                 real scale) {}

96 97 98 99 100 101 102 103 104 105 106 107 108
inline void hl_matrix_add_shared_bias(real* A_d,
                                      real* B_d,
                                      const int channel,
                                      const int dimM,
                                      const int dimN,
                                      real scale) {}

inline void hl_matrix_collect_shared_bias(real* B_d,
                                          real* A_d,
                                          const int channel,
                                          const int dimM,
                                          const int dimN,
                                          real scale) {}
Z
zhangjinchao01 已提交
109
#endif  // HL_MATRIX_STUB_H_