for(x = 0; x<outx; x++) { for (ch = 0; ch < channels; ch++) { odata[batchidx*ostr0 + y*ostr1 + x*ostr2 + ch*ostr3] = idata[batchidx*istr0 + (y+ystart-1)*istr1 + (x+xstart-1)*istr2 + ch*istr3]; } } } } } return 1; } static const struct luaL_Reg nxn_(Jitter__) [] = { {"Jitter_updateOutput", nxn_(Jitter_updateOutput)}, {NULL, NULL} }; static void nxn_(Jitter_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(Jitter__), "nxn"); lua_pop(L,1); } #endif
static void nxn_(Jitter_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(Jitter__), "nxn"); lua_pop(L,1); }
static void nxn_(CrossMapNormalization_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(CrossMapNormalization__), "nxn"); lua_pop(L,1); }
{ curgiptr[ch] -= ai * curzptr[j]; } } } return 1; } static const struct luaL_Reg nxn_(CrossMapNormalization__) [] = { {"CrossMapNormalization_updateOutput", nxn_(CrossMapNormalization_updateOutput)}, {"CrossMapNormalization_updateGradInput", nxn_(CrossMapNormalization_updateGradInput)}, {NULL, NULL} }; static void nxn_(CrossMapNormalization_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(CrossMapNormalization__), "nxn"); lua_pop(L,1); } #endif
static void nxn_(SpatialMaxPoolingBHWD_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(SpatialMaxPoolingBHWD__), "nn"); lua_pop(L,1); }
{ yi=(int)(maxind[ch-chb*16])/kW; xi=(int)(maxind[ch-chb*16])%kW; ptrgradinput[idx*gistr0+(yo*dH+yi)*gistr1+(xo*dW+xi)*gistr2+ch]+=goval[ch-chb*16]; } } } } } /* cleanup */ /*THTensor_(free)(gradOutput);*/ return 1; } static const struct luaL_Reg nxn_(SpatialMaxPoolingBHWD__) [] = { {"SpatialMaxPoolingBHWD_updateOutput", nxn_(SpatialMaxPooling_updateOutput)}, {"SpatialMaxPoolingBHWD_updateGradInput", nxn_(SpatialMaxPooling_updateGradInput)}, {NULL, NULL} }; static void nxn_(SpatialMaxPoolingBHWD_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(SpatialMaxPoolingBHWD__), "nn"); lua_pop(L,1); } #endif
for(x = 0; x<xmax; x++) { for (ch = 0; ch < channels; ch++) { if(maskdata[batchidx*channels+ch]==0) { gidata[batchidx*gistr0 + y*gistr1 + x*gistr2 + ch*gistr3] = 0; } else { gidata[batchidx*gistr0 + y*gistr1 + x*gistr2 + ch*gistr3] = godata[batchidx*gostr0 + y*gostr1 + x*gostr2 + ch*gostr3]; } } } } } } return 1; } static const struct luaL_Reg nxn_(Dropmap__) [] = { {"Dropmap_updateOutput", nxn_(Dropmap_updateOutput)}, {"Dropmap_updateGradInput", nxn_(Dropmap_updateGradInput)}, {NULL, NULL} }; static void nxn_(Dropmap_init)(lua_State *L) { luaT_pushmetatable(L, torch_Tensor); luaT_registeratname(L, nxn_(Dropmap__), "nxn"); lua_pop(L,1); } #endif