1 #ifndef TH_GENERIC_FILE 2 #define TH_GENERIC_FILE "TH/generic/THTensorFill.cpp" 5 #include <TH/generic/THTensorApply.hpp> 7 void THTensor_(fill)(THTensor *r_, scalar_t value)
9 if (THTensor_(isContiguous)(r_) || THTensor_(isTransposed)(r_)) {
10 TH_TENSOR_APPLY_CONTIG(scalar_t, r_, THVector_(fill)(r__data, value, r__len););
12 TH_TENSOR_APPLY(scalar_t, r_,
14 THVector_(fill)(r__data, value, r__size);
16 r__data += r__stride * r__size;
25 void THTensor_(zero)(THTensor *r_)
27 THTensor_(fill)(r_, 0);