@@ -36,17 +36,12 @@ def sample_program_configs(self):
3636 def generate_input1 (dims , batch ):
3737 if dims == 1 :
3838 return np .ones (shape = [batch ]).astype (np .float32 )
39- elif dims == 2 :
40- return np .ones (shape = [batch , 3 ]).astype (np .float32 )
4139 elif dims == 3 :
4240 return np .ones ((batch , 2 , 3 )).astype (np .float32 )
4341
4442 def generate_equation1 (dims ):
4543 if dims == 1 :
4644 return ["i->" ]
47- elif dims == 2 :
48- # "ij->"
49- return ["ij->ji" , "ij->i" , "ij->j" ]
5045 elif dims == 3 :
5146 # "ijk->","ijk->j","ijk->k"
5247 # error: The current implementation of Einsum doesn't support mask dimensions on multiple contracting/free dimensions
@@ -60,7 +55,7 @@ def generate_equation1(dims):
6055 ]
6156
6257 # Single operand: transpose, sum
63- for dims in [1 , 2 , 3 ]:
58+ for dims in [1 , 3 ]:
6459 for batch in [2 ]:
6560 equation_list = generate_equation1 (dims )
6661 for equation in equation_list :
@@ -108,16 +103,7 @@ def generate_dynamic_shape(attrs):
108103 self .dynamic_shape .opt_input_shape = {
109104 "operands_data0" : [2 ],
110105 }
111- elif self .dims == 2 :
112- self .dynamic_shape .min_input_shape = {
113- "operands_data0" : [1 , 3 ],
114- }
115- self .dynamic_shape .max_input_shape = {
116- "operands_data0" : [4 , 3 ],
117- }
118- self .dynamic_shape .opt_input_shape = {
119- "operands_data0" : [2 , 3 ],
120- }
106+
121107 elif self .dims == 3 :
122108 self .dynamic_shape .min_input_shape = {
123109 "operands_data0" : [1 , 2 , 3 ],
@@ -219,18 +205,12 @@ def generate_equation_matrix_vector(dims, vec_shape):
219205 # Doubule operands vector
220206 for dims in [1 ]:
221207 self .dims = dims
222- for vec_shape in [[2 ], [ 3 ] ]:
208+ for vec_shape in [[2 ]]:
223209 for batch in [2 ]:
224210 equation_list = generate_equation_matrix_vector (
225211 dims , vec_shape
226212 )
227213 for equation in equation_list :
228- if (
229- dims == 1
230- and vec_shape != [2 ]
231- and equation != "i,j->ij"
232- ) or ((dims == 2 or dims == 3 ) and vec_shape != [3 ]):
233- continue
234214 self .equation = equation
235215 self .dims = dims
236216 dics = [{"equation" : equation }, {}]
@@ -286,19 +266,6 @@ def generate_dynamic_shape(attrs):
286266 "operands_data0" : [2 ],
287267 "operands_data1" : [2 ],
288268 }
289- elif self .dims == 2 :
290- self .dynamic_shape .min_input_shape = {
291- "operands_data0" : [1 , 3 ],
292- "operands_data1" : [1 ],
293- }
294- self .dynamic_shape .max_input_shape = {
295- "operands_data0" : [4 , 3 ],
296- "operands_data1" : [4 ],
297- }
298- self .dynamic_shape .opt_input_shape = {
299- "operands_data0" : [2 , 3 ],
300- "operands_data1" : [3 ],
301- }
302269 elif self .dims == 3 :
303270 self .dynamic_shape .min_input_shape = {
304271 "operands_data0" : [1 , 2 , 3 ],
@@ -379,13 +346,6 @@ def generate_input_matrix(input_shape):
379346 [[3 , 4 , 5 ], [4 , 5 ], "ijk,jk->i" ],
380347 [[3 , 4 , 5 ], [2 , 5 ], "ijk,lk->ijl" ],
381348 [[2 , 4 , 5 , 3 ], [3 , 4 , 5 ], "ijkl,lmn->ijkmn" ],
382- [[3 , 4 , 5 ], [4 , 5 ], "ijk,jk->ik" ],
383- [[3 , 4 , 5 ], [4 , 5 ], "ijk,jk->ij" ],
384- [[4 , 5 ], [4 , 2 , 5 ], "ik,ijk->j" ],
385- [[4 , 2 , 5 ], [4 , 5 ], "ijk,ik->jk" ],
386- [[2 , 4 , 5 , 3 ], [3 , 2 , 4 ], "ijkl,lmn->kmn" ],
387- [[2 , 4 , 5 , 3 ], [3 , 2 , 4 ], "ijkl,lmn->ijn" ],
388- [[1 , 3 , 5 ], [1 , 2 , 3 , 4 ], "blq,bhlk->bhlqk" ],
389349 ]:
390350 self .x_shape = item [0 ]
391351 self .y_shape = item [1 ]
0 commit comments