Commit 0cc8c738 authored by Laurens van der Maaten's avatar Laurens van der Maaten
Browse files

Fix shadowed declarations.

parent b87ba095
...@@ -25,15 +25,15 @@ extern "C" void scn_DR_(SparseToDense_updateOutput)( ...@@ -25,15 +25,15 @@ extern "C" void scn_DR_(SparseToDense_updateOutput)(
} }
if (input_features->nDimension == 2) { if (input_features->nDimension == 2) {
auto _rules = _m.getSparseToDenseRuleBook(inputSize, true); auto _rules = _m.getSparseToDenseRuleBook(inputSize, true);
uInt nPlanes = input_features->size[1]; uInt _nPlanes = input_features->size[1];
auto iF = THTensor_(data)(input_features); auto iF = THTensor_(data)(input_features);
auto oF = THTensor_(data)(output_features); auto oF = THTensor_(data)(output_features);
long spatialVolume = THLongTensor_prodall(inputSize); long spatialVolume = THLongTensor_prodall(inputSize);
for (auto &r : _rules) { for (auto &r : _rules) {
uInt nHot = r.size() / 2; uInt nHot = r.size() / 2;
SparseToDense_ForwardPass<real>(iF, oF, nPlanes, spatialVolume, &r[0], SparseToDense_ForwardPass<real>(iF, oF, _nPlanes, spatialVolume, &r[0],
nHot); nHot);
oF += nPlanes * spatialVolume; oF += _nPlanes * spatialVolume;
} }
} }
} }
...@@ -48,15 +48,15 @@ extern "C" void scn_DR_(SparseToDense_updateGradInput)( ...@@ -48,15 +48,15 @@ extern "C" void scn_DR_(SparseToDense_updateGradInput)(
auto _rules = _m.getSparseToDenseRuleBook(inputSize, true); auto _rules = _m.getSparseToDenseRuleBook(inputSize, true);
if (input_features->nDimension == 2) { if (input_features->nDimension == 2) {
long spatialVolume = THLongTensor_prodall(inputSize); long spatialVolume = THLongTensor_prodall(inputSize);
uInt nPlanes = d_input_features->size[1]; uInt _nPlanes = d_input_features->size[1];
auto diF = THTensor_(data)(d_input_features); auto diF = THTensor_(data)(d_input_features);
auto doF = THTensor_(data)(d_output_features); auto doF = THTensor_(data)(d_output_features);
for (auto &r : _rules) { for (auto &r : _rules) {
uInt nHot = r.size() / 2; uInt nHot = r.size() / 2;
SparseToDense_BackwardPass<real>(diF, doF, nPlanes, spatialVolume, &r[0], SparseToDense_BackwardPass<real>(diF, doF, _nPlanes, spatialVolume, &r[0],
nHot); nHot);
doF += nPlanes * spatialVolume; doF += _nPlanes * spatialVolume;
} }
} }
} }
......
...@@ -29,13 +29,13 @@ extern "C" void scn_DR_(SparseToDense_updateOutput)( ...@@ -29,13 +29,13 @@ extern "C" void scn_DR_(SparseToDense_updateOutput)(
} }
if (input_features->nDimension == 2) { if (input_features->nDimension == 2) {
auto _rules = _m.getSparseToDenseRuleBook(inputSize, true); auto _rules = _m.getSparseToDenseRuleBook(inputSize, true);
uInt nPlanes = input_features->size[1]; uInt _nPlanes = input_features->size[1];
auto iF = THCTensor_(data)(state, input_features); auto iF = THCTensor_(data)(state, input_features);
auto oF = THCTensor_(data)(state, output_features); auto oF = THCTensor_(data)(state, output_features);
RULEBOOKITERATOR( RULEBOOKITERATOR(
SparseToDense_ForwardPass<real>(THCState_getCurrentStream(state), iF, SparseToDense_ForwardPass<real>(THCState_getCurrentStream(state), iF,
oF, nPlanes, spatialVolume, rbB, nHotB); oF, _nPlanes, spatialVolume, rbB, nHotB);
, oF += nPlanes * spatialVolume;) , oF += _nPlanes * spatialVolume;)
} }
} }
extern "C" void scn_DR_(SparseToDense_updateGradInput)( extern "C" void scn_DR_(SparseToDense_updateGradInput)(
...@@ -50,13 +50,13 @@ extern "C" void scn_DR_(SparseToDense_updateGradInput)( ...@@ -50,13 +50,13 @@ extern "C" void scn_DR_(SparseToDense_updateGradInput)(
if (input_features->nDimension == 2) { if (input_features->nDimension == 2) {
auto _rules = _m.getSparseToDenseRuleBook(inputSize, true); auto _rules = _m.getSparseToDenseRuleBook(inputSize, true);
long spatialVolume = THLongTensor_prodall(inputSize); long spatialVolume = THLongTensor_prodall(inputSize);
uInt nPlanes = d_input_features->size[1]; uInt _nPlanes = d_input_features->size[1];
auto diF = THCTensor_(data)(state, d_input_features); auto diF = THCTensor_(data)(state, d_input_features);
auto doF = THCTensor_(data)(state, d_output_features); auto doF = THCTensor_(data)(state, d_output_features);
RULEBOOKITERATOR(SparseToDense_BackwardPass<real>( RULEBOOKITERATOR(SparseToDense_BackwardPass<real>(
THCState_getCurrentStream(state), diF, doF, nPlanes, THCState_getCurrentStream(state), diF, doF, _nPlanes,
spatialVolume, rbB, nHotB); spatialVolume, rbB, nHotB);
, doF += nPlanes * spatialVolume;) , doF += _nPlanes * spatialVolume;)
} }
} }
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment