@@ -46,6 +46,40 @@ const scatterElementsTests = [
46
46
}
47
47
}
48
48
} ,
49
+ {
50
+ 'name' : 'Scatter elements along axis 0 and constant indices' ,
51
+ 'graph' : {
52
+ 'inputs' : {
53
+ 'input' : {
54
+ 'data' : [ 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ] ,
55
+ 'descriptor' : { shape : [ 3 , 3 ] , dataType : 'float32' }
56
+ } ,
57
+ 'indices' : {
58
+ 'data' : [ 1 , 0 , 2 , 0 , 2 , 1 ] ,
59
+ 'descriptor' : { shape : [ 2 , 3 ] , dataType : 'int32' } ,
60
+ 'constant' : true
61
+ } ,
62
+ 'updates' : {
63
+ 'data' : [ 1.0 , 1.1 , 1.2 , 2.0 , 2.1 , 2.2 ] ,
64
+ 'descriptor' : { shape : [ 2 , 3 ] , dataType : 'float32' }
65
+ }
66
+ } ,
67
+ 'operators' : [ {
68
+ 'name' : 'scatterElements' ,
69
+ 'arguments' : [
70
+ { 'input' : 'input' } , { 'indices' : 'indices' } , { 'updates' : 'updates' } ,
71
+ { 'options' : { 'axis' : 0 } }
72
+ ] ,
73
+ 'outputs' : 'output'
74
+ } ] ,
75
+ 'expectedOutputs' : {
76
+ 'output' : {
77
+ 'data' : [ 2.0 , 1.1 , 0.0 , 1.0 , 0.0 , 2.2 , 0.0 , 2.1 , 1.2 ] ,
78
+ 'descriptor' : { shape : [ 3 , 3 ] , dataType : 'float32' }
79
+ }
80
+ }
81
+ }
82
+ } ,
49
83
{
50
84
'name' : 'Scatter elements along axis 1' ,
51
85
'graph' : {
@@ -78,6 +112,40 @@ const scatterElementsTests = [
78
112
}
79
113
}
80
114
}
115
+ } ,
116
+ {
117
+ 'name' : 'Scatter elements along axis 1 and constant indices' ,
118
+ 'graph' : {
119
+ 'inputs' : {
120
+ 'input' : {
121
+ 'data' : [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ] ,
122
+ 'descriptor' : { shape : [ 1 , 5 ] , dataType : 'float32' }
123
+ } ,
124
+ 'indices' : {
125
+ 'data' : [ 1 , 3 ] ,
126
+ 'descriptor' : { shape : [ 1 , 2 ] , dataType : 'int32' } ,
127
+ 'constant' : true
128
+ } ,
129
+ 'updates' : {
130
+ 'data' : [ 1.1 , 2.1 ] ,
131
+ 'descriptor' : { shape : [ 1 , 2 ] , dataType : 'float32' }
132
+ }
133
+ } ,
134
+ 'operators' : [ {
135
+ 'name' : 'scatterElements' ,
136
+ 'arguments' : [
137
+ { 'input' : 'input' } , { 'indices' : 'indices' } , { 'updates' : 'updates' } ,
138
+ { 'options' : { 'axis' : 1 } }
139
+ ] ,
140
+ 'outputs' : 'output'
141
+ } ] ,
142
+ 'expectedOutputs' : {
143
+ 'output' : {
144
+ 'data' : [ 1.0 , 1.1 , 3.0 , 2.1 , 5.0 ] ,
145
+ 'descriptor' : { shape : [ 1 , 5 ] , dataType : 'float32' }
146
+ }
147
+ }
148
+ }
81
149
}
82
150
] ;
83
151
0 commit comments