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-scatter
Commits
8ef7174b
Commit
8ef7174b
authored
Dec 16, 2017
by
rusty1s
Browse files
bugfix
parent
05665f46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
17 deletions
+7
-17
torch_scatter/src/cpu.c
torch_scatter/src/cpu.c
+0
-2
torch_scatter/src/cpu.h
torch_scatter/src/cpu.h
+0
-4
torch_scatter/src/generic/cpu.c
torch_scatter/src/generic/cpu.c
+7
-11
No files found.
torch_scatter/src/cpu.c
View file @
8ef7174b
...
@@ -8,5 +8,3 @@ inline void assertIndexInBoundaries(int idx, int size, int64_t *free) {
...
@@ -8,5 +8,3 @@ inline void assertIndexInBoundaries(int idx, int size, int64_t *free) {
#include "generic/cpu.c"
#include "generic/cpu.c"
#include "THGenerateAllTypes.h"
#include "THGenerateAllTypes.h"
#include "generic/cpu.c"
#include "THGenerateHalfType.h"
torch_scatter/src/cpu.h
View file @
8ef7174b
void
scatter_add_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_add_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_add_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
void
scatter_add_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
/* void scatter_add_Half (THHalfTensor *output, THLongTensor *index, THHalfTensor *input, int dim); */
void
scatter_add_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_add_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_add_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_add_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_add_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
void
scatter_add_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
...
@@ -9,7 +8,6 @@ void scatter_add_Long (THLongTensor *output, THLongTensor *index, THLongTenso
...
@@ -9,7 +8,6 @@ void scatter_add_Long (THLongTensor *output, THLongTensor *index, THLongTenso
void
scatter_sub_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_sub_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_sub_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
void
scatter_sub_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
/* void scatter_sub_Half (THHalfTensor *output, THLongTensor *index, THHalfTensor *input, int dim); */
void
scatter_sub_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_sub_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_sub_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_sub_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_sub_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
void
scatter_sub_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
...
@@ -18,7 +16,6 @@ void scatter_sub_Long (THLongTensor *output, THLongTensor *index, THLongTenso
...
@@ -18,7 +16,6 @@ void scatter_sub_Long (THLongTensor *output, THLongTensor *index, THLongTenso
void
scatter_mul_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_mul_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_mul_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
void
scatter_mul_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
/* void scatter_mul_Half (THHalfTensor *output, THLongTensor *index, THHalfTensor *input, int dim); */
void
scatter_mul_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_mul_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_mul_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_mul_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_mul_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
void
scatter_mul_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
...
@@ -27,7 +24,6 @@ void scatter_mul_Long (THLongTensor *output, THLongTensor *index, THLongTenso
...
@@ -27,7 +24,6 @@ void scatter_mul_Long (THLongTensor *output, THLongTensor *index, THLongTenso
void
scatter_div_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_div_Float
(
THFloatTensor
*
output
,
THLongTensor
*
index
,
THFloatTensor
*
input
,
int
dim
);
void
scatter_div_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
void
scatter_div_Double
(
THDoubleTensor
*
output
,
THLongTensor
*
index
,
THDoubleTensor
*
input
,
int
dim
);
/* void scatter_div_Half (THHalfTensor *output, THLongTensor *index, THHalfTensor *input, int dim); */
void
scatter_div_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_div_Byte
(
THByteTensor
*
output
,
THLongTensor
*
index
,
THByteTensor
*
input
,
int
dim
);
void
scatter_div_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_div_Char
(
THCharTensor
*
output
,
THLongTensor
*
index
,
THCharTensor
*
input
,
int
dim
);
void
scatter_div_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
void
scatter_div_Short
(
THShortTensor
*
output
,
THLongTensor
*
index
,
THShortTensor
*
input
,
int
dim
);
...
...
torch_scatter/src/generic/cpu.c
View file @
8ef7174b
...
@@ -4,8 +4,7 @@
...
@@ -4,8 +4,7 @@
void
scatter_
(
add
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
void
scatter_
(
add
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
int64_t
idx
;
int64_t
idx
;
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
idx
=
*
(
index_data
+
i
*
index_stride
);
idx
=
*
(
index_data
+
i
*
index_stride
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
...
@@ -15,34 +14,31 @@ void scatter_(add)(THTensor *output, THLongTensor *index, THTensor *input, int d
...
@@ -15,34 +14,31 @@ void scatter_(add)(THTensor *output, THLongTensor *index, THTensor *input, int d
void
scatter_
(
sub
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
void
scatter_
(
sub
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
int64_t
idx
;
int64_t
idx
;
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
idx
=
*
(
index_data
+
i
*
index_stride
);
idx
=
*
(
index_data
+
i
*
index_stride
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
output_data
[
idx
]
+
=
*
(
input_data
+
i
*
input_stride
);
output_data
[
idx
]
-
=
*
(
input_data
+
i
*
input_stride
);
})
})
}
}
void
scatter_
(
mul
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
void
scatter_
(
mul
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
int64_t
idx
;
int64_t
idx
;
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
idx
=
*
(
index_data
+
i
*
index_stride
);
idx
=
*
(
index_data
+
i
*
index_stride
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
output_data
[
idx
]
+
=
*
(
input_data
+
i
*
input_stride
);
output_data
[
idx
]
*
=
*
(
input_data
+
i
*
input_stride
);
})
})
}
}
void
scatter_
(
div
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
void
scatter_
(
div
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
int64_t
idx
;
int64_t
idx
;
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3
(
real
,
output
,
real
,
input
,
int64_t
,
index
,
dim
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
TH_TENSOR_DIM_APPLY3_SIZE_EQ_EXCEPT_DIM
,
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
for
(
int64_t
i
=
0
;
i
<
THLongTensor_size
(
index
,
dim
);
i
++
)
{
idx
=
*
(
index_data
+
i
*
index_stride
);
idx
=
*
(
index_data
+
i
*
index_stride
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
assertIndexInBoundaries
(
idx
,
output_size
,
TH_TENSOR_DIM_APPLY_counter
);
output_data
[
idx
]
+
=
*
(
input_data
+
i
*
input_stride
);
output_data
[
idx
]
/
=
*
(
input_data
+
i
*
input_stride
);
})
})
}
}
...
...
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