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
96addd52
Commit
96addd52
authored
Sep 13, 2017
by
Benjamin Graham
Browse files
add batch information to getSpatialLocations
parent
86f46cb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
PyTorch/sparseconvnet/SCN/generic/Geometry/Metadata.cpp
PyTorch/sparseconvnet/SCN/generic/Geometry/Metadata.cpp
+4
-2
Torch/C.lua
Torch/C.lua
+2
-0
No files found.
PyTorch/sparseconvnet/SCN/generic/Geometry/Metadata.cpp
View file @
96addd52
...
...
@@ -100,6 +100,7 @@ extern "C" void scn_D_(setInputSpatialLocations)(void **m,
}
}
}
extern
"C"
void
scn_D_
(
getSpatialLocations
)(
void
**
m
,
THLongTensor
*
spatialSize
,
THLongTensor
*
locations
)
{
...
...
@@ -108,7 +109,7 @@ extern "C" void scn_D_(getSpatialLocations)(void **m,
auto
&
SGs
=
_m
.
getSparseGrid
(
spatialSize
);
uInt
batchSize
=
SGs
.
size
();
THLongTensor_resize2d
(
locations
,
nActive
,
Dimension
);
THLongTensor_resize2d
(
locations
,
nActive
,
Dimension
+
1
);
THLongTensor_zero
(
locations
);
auto
lD
=
THLongTensor_data
(
locations
);
...
...
@@ -117,8 +118,9 @@ extern "C" void scn_D_(getSpatialLocations)(void **m,
auto
mp
=
SGs
[
i
].
mp
;
for
(
auto
it
=
mp
.
begin
();
it
!=
mp
.
end
();
++
it
)
{
for
(
uInt
d
=
0
;
d
<
Dimension
;
++
d
)
{
lD
[
it
->
second
*
Dimension
+
d
]
=
it
->
first
[
d
];
lD
[
it
->
second
*
(
Dimension
+
1
)
+
d
]
=
it
->
first
[
d
];
}
lD
[
it
->
second
*
(
Dimension
+
1
)
+
Dimension
]
=
i
;
}
}
}
...
...
Torch/C.lua
View file @
96addd52
...
...
@@ -49,6 +49,8 @@ return function (sparseconvnet)
void scn_DIMENSION_setInputSpatialLocation(void **m,
THFloatTensor *features, THLongTensor *location, THFloatTensor *vec,
bool overwrite);
void scn_5_getSpatialLocations(void **m,
THLongTensor *spatialSize, THLongTensor *locations);
void scn_DIMENSION_setInputSpatialLocations(void **m,
THFloatTensor *features, THLongTensor *locations, THFloatTensor *vecs,
bool overwrite);
...
...
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