Skip to content

Commit ba9ff50

Browse files
committed
temp fix
1 parent a507845 commit ba9ff50

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

paddle/fluid/operators/math/matrix_bit_code.cc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,33 @@ void MatrixBitCodeFunctor<T>::MulGradWeight(const framework::Tensor& tmat,
119119
}
120120
}
121121

122+
// template <typename T>
123+
// void MatrixBitCodeFunctor<T>::MulGradSparseWeight(const framework::Tensor&
124+
// tmat,
125+
// framework::SelectedRows* weight,
126+
// const framework::Tensor& input) {
127+
// size_t num_samples = tmat.dims()[0];
128+
// size_t input_width = input.dims()[1];
129+
// size_t tmat_width = tmat.dims()[1];
130+
// size_t weight_width = weight->dims()[1];
131+
// auto tmat_value = tmat.data<T>();
132+
// auto weight_value = weight->data<T>();
133+
// auto input_value = input.data<T>();
134+
// for (size_t i = 0; i < num_samples; ++i) {
135+
// auto code = code_table->get_code(i);
136+
// int code_length = code->get_length();
137+
// for (int j = 0; j < code_length; ++j) {
138+
// // size_t index = code->calc_index(j);
139+
140+
// for (size_t k = 0; k < input_width; ++k) {
141+
// weight_value[j * weight_width + k] +=
142+
// tmat_value[i * tmat_width + j] * input_value[input_width * i +
143+
// k];
144+
// }
145+
// }
146+
// }
147+
// }
148+
122149
template <typename T>
123150
void MatrixBitCodeFunctor<T>::MulGradError(const framework::Tensor& tmat,
124151
const framework::Tensor& weight,

0 commit comments

Comments
 (0)