Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
SparseConvNet
Commits
0cc8c738
Commit
0cc8c738
authored
Feb 08, 2018
by
Laurens van der Maaten
Browse files
Fix shadowed declarations.
parent
b87ba095
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
PyTorch/sparseconvnet/SCN/generic/CPU/SparseToDense.cpp
PyTorch/sparseconvnet/SCN/generic/CPU/SparseToDense.cpp
+6
-6
PyTorch/sparseconvnet/SCN/generic/GPU/SparseToDense.cu
PyTorch/sparseconvnet/SCN/generic/GPU/SparseToDense.cu
+6
-6
No files found.
PyTorch/sparseconvnet/SCN/generic/CPU/SparseToDense.cpp
View file @
0cc8c738
...
...
@@ -25,15 +25,15 @@ extern "C" void scn_DR_(SparseToDense_updateOutput)(
}
if
(
input_features
->
nDimension
==
2
)
{
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
oF
=
THTensor_
(
data
)(
output_features
);
long
spatialVolume
=
THLongTensor_prodall
(
inputSize
);
for
(
auto
&
r
:
_rules
)
{
uInt
nHot
=
r
.
size
()
/
2
;
SparseToDense_ForwardPass
<
real
>
(
iF
,
oF
,
nPlanes
,
spatialVolume
,
&
r
[
0
],
SparseToDense_ForwardPass
<
real
>
(
iF
,
oF
,
_
nPlanes
,
spatialVolume
,
&
r
[
0
],
nHot
);
oF
+=
nPlanes
*
spatialVolume
;
oF
+=
_
nPlanes
*
spatialVolume
;
}
}
}
...
...
@@ -48,15 +48,15 @@ extern "C" void scn_DR_(SparseToDense_updateGradInput)(
auto
_rules
=
_m
.
getSparseToDenseRuleBook
(
inputSize
,
true
);
if
(
input_features
->
nDimension
==
2
)
{
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
doF
=
THTensor_
(
data
)(
d_output_features
);
for
(
auto
&
r
:
_rules
)
{
uInt
nHot
=
r
.
size
()
/
2
;
SparseToDense_BackwardPass
<
real
>
(
diF
,
doF
,
nPlanes
,
spatialVolume
,
&
r
[
0
],
SparseToDense_BackwardPass
<
real
>
(
diF
,
doF
,
_
nPlanes
,
spatialVolume
,
&
r
[
0
],
nHot
);
doF
+=
nPlanes
*
spatialVolume
;
doF
+=
_
nPlanes
*
spatialVolume
;
}
}
}
...
...
PyTorch/sparseconvnet/SCN/generic/GPU/SparseToDense.cu
View file @
0cc8c738
...
...
@@ -29,13 +29,13 @@ extern "C" void scn_DR_(SparseToDense_updateOutput)(
}
if
(
input_features
->
nDimension
==
2
)
{
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
oF
=
THCTensor_
(
data
)(
state
,
output_features
);
RULEBOOKITERATOR
(
SparseToDense_ForwardPass
<
real
>
(
THCState_getCurrentStream
(
state
),
iF
,
oF
,
nPlanes
,
spatialVolume
,
rbB
,
nHotB
);
,
oF
+=
nPlanes
*
spatialVolume
;)
oF
,
_
nPlanes
,
spatialVolume
,
rbB
,
nHotB
);
,
oF
+=
_
nPlanes
*
spatialVolume
;)
}
}
extern
"C"
void
scn_DR_
(
SparseToDense_updateGradInput
)(
...
...
@@ -50,13 +50,13 @@ extern "C" void scn_DR_(SparseToDense_updateGradInput)(
if
(
input_features
->
nDimension
==
2
)
{
auto
_rules
=
_m
.
getSparseToDenseRuleBook
(
inputSize
,
true
);
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
doF
=
THCTensor_
(
data
)(
state
,
d_output_features
);
RULEBOOKITERATOR
(
SparseToDense_BackwardPass
<
real
>
(
THCState_getCurrentStream
(
state
),
diF
,
doF
,
nPlanes
,
THCState_getCurrentStream
(
state
),
diF
,
doF
,
_
nPlanes
,
spatialVolume
,
rbB
,
nHotB
);
,
doF
+=
nPlanes
*
spatialVolume
;)
,
doF
+=
_
nPlanes
*
spatialVolume
;)
}
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment