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
torch-spline-conv
Commits
2d394e78
"vscode:/vscode.git/clone" did not exist on "f453b03f392ea77d091018a303a0c661770e4753"
Commit
2d394e78
authored
Mar 09, 2018
by
rusty1s
Browse files
first fw try
parent
3a07cc5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
torch_spline_conv/src/generic/cpu.c
torch_spline_conv/src/generic/cpu.c
+19
-0
No files found.
torch_spline_conv/src/generic/cpu.c
View file @
2d394e78
...
@@ -51,6 +51,25 @@ void spline_(basis_cubic)(THTensor *basis, THLongTensor *weight_index, THTensor
...
@@ -51,6 +51,25 @@ void spline_(basis_cubic)(THTensor *basis, THLongTensor *weight_index, THTensor
}
}
void
spline_
(
weighting_fw
)(
THTensor
*
output
,
THTensor
*
input
,
THTensor
*
weight
,
THTensor
*
basis
,
THLongTensor
*
weight_index
)
{
void
spline_
(
weighting_fw
)(
THTensor
*
output
,
THTensor
*
input
,
THTensor
*
weight
,
THTensor
*
basis
,
THLongTensor
*
weight_index
)
{
real
*
weight_data
=
weight
->
storage
->
data
+
weight
->
storageOffset
;
int64_t
M_out
=
THTensor_
(
size
)(
output
,
1
);
int64_t
M_in
=
THTensor_
(
size
)(
input
,
1
);
int64_t
S
=
THLongTensor_size
(
weight_index
,
1
);
int64_t
m_out
,
m_in
,
s
,
i
;
real
b
,
value
;
TH_TENSOR_DIM_APPLY4
(
real
,
output
,
real
,
input
,
real
,
basis
,
int64_t
,
weight_index
,
1
,
for
(
m_out
=
0
;
m_out
<
M_out
;
m_out
++
)
{
value
=
0
;
for
(
s
=
0
;
s
<
S
;
s
++
)
{
b
=
*
(
basis_data
+
s
*
basis_stride
);
i
=
*
(
weight_index_data
+
s
*
weight_index_stride
);
for
(
m_in
=
0
;
m_in
<
M_in
;
m_in
++
)
{
value
+=
b
*
*
(
weight_data
+
i
*
M_in
*
M_out
+
m_in
*
M_in
+
m_out
)
*
*
(
input_data
+
m_in
*
input_stride
);
}
}
output_data
[
m_out
*
output_stride
]
=
value
;
}
)
}
}
void
spline_
(
weighting_bw
)(
THTensor
*
grad_input
,
THTensor
*
grad_weight
,
THTensor
*
grad_output
,
THTensor
*
input
,
THTensor
*
weight
,
THTensor
*
basis
,
THLongTensor
*
weight_index
)
{
void
spline_
(
weighting_bw
)(
THTensor
*
grad_input
,
THTensor
*
grad_weight
,
THTensor
*
grad_output
,
THTensor
*
input
,
THTensor
*
weight
,
THTensor
*
basis
,
THLongTensor
*
weight_index
)
{
...
...
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