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-cluster
Commits
6c85ffa2
Unverified
Commit
6c85ffa2
authored
Aug 10, 2018
by
Matthias Fey
Committed by
GitHub
Aug 10, 2018
Browse files
Merge pull request #5 from sebp/fix-pytorch-0.4.1
Fix build for pytorch 0.4.1
parents
6ce5c2e8
b681c4b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
aten/TH/generic/THGrid.c
aten/TH/generic/THGrid.c
+4
-2
No files found.
aten/TH/generic/THGrid.c
View file @
6c85ffa2
...
...
@@ -6,16 +6,18 @@ void THTensor_(grid)(THLongTensor *self, THTensor *pos, THTensor *size, THLongTe
int64_t
*
selfData
=
THLongTensor_data
(
self
);
real
*
posData
=
THTensor_
(
data
)(
pos
);
real
*
sizeData
=
THTensor_
(
data
)(
size
);
int64_t
posStride0
=
THTensor_
(
stride
)(
pos
,
0
);
int64_t
posStride1
=
THTensor_
(
stride
)(
pos
,
1
);
int64_t
*
countData
=
THLongTensor_data
(
count
);
ptrdiff_t
n
,
d
;
int64_t
coef
,
value
;
for
(
n
=
0
;
n
<
THTensor_
(
size
)(
pos
,
0
);
n
++
)
{
coef
=
1
;
value
=
0
;
for
(
d
=
0
;
d
<
THTensor_
(
size
)(
pos
,
1
);
d
++
)
{
value
+=
coef
*
(
int64_t
)
(
posData
[
d
*
pos
->
s
tride
[
1
]
]
/
sizeData
[
d
]);
value
+=
coef
*
(
int64_t
)
(
posData
[
d
*
pos
S
tride
1
]
/
sizeData
[
d
]);
coef
*=
countData
[
d
];
}
posData
+=
pos
->
s
tride
[
0
]
;
posData
+=
pos
S
tride
0
;
selfData
[
n
]
=
value
;
}
}
...
...
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