| 55 | |
| 56 | template <typename Dtype> |
| 57 | void caffe_set(const int N, const Dtype alpha, Dtype* Y) { |
| 58 | if (alpha == 0) { |
| 59 | memset(Y, 0, sizeof(Dtype) * N); // NOLINT(caffe/alt_fn) |
| 60 | return; |
| 61 | } |
| 62 | for (int i = 0; i < N; ++i) { |
| 63 | Y[i] = alpha; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | template void caffe_set<int>(const int N, const int alpha, int* Y); |
| 68 | template void caffe_set<float>(const int N, const float alpha, float* Y); |
no outgoing calls