1212
1313"""
1414----------inputs for ./2stems/vocals.onnx----------
15- NodeArg(name='x', type='tensor(float)', shape=['num_splits', 2 , 512, 1024])
15+ NodeArg(name='x', type='tensor(float)', shape=[2, 'num_splits', 512, 1024])
1616----------outputs for ./2stems/vocals.onnx----------
17- NodeArg(name='y', type='tensor(float)', shape=['Muly_dim_0', 2 , 512, 1024])
17+ NodeArg(name='y', type='tensor(float)', shape=[2, 'Transposey_dim_1' , 512, 1024])
1818
1919----------inputs for ./2stems/accompaniment.onnx----------
20- NodeArg(name='x', type='tensor(float)', shape=['num_splits', 2 , 512, 1024])
20+ NodeArg(name='x', type='tensor(float)', shape=[2, 'num_splits', 512, 1024])
2121----------outputs for ./2stems/accompaniment.onnx----------
22- NodeArg(name='y', type='tensor(float)', shape=['Muly_dim_0', 2, 512, 1024])
23-
22+ NodeArg(name='y', type='tensor(float)', shape=[2, 'Transposey_dim_1', 512, 1024])
2423"""
2524
2625
@@ -123,16 +122,16 @@ def main():
123122 if padding > 0 :
124123 stft0 = torch .nn .functional .pad (stft0 , (0 , 0 , 0 , padding ))
125124 stft1 = torch .nn .functional .pad (stft1 , (0 , 0 , 0 , padding ))
126- stft0 = stft0 .reshape (- 1 , 1 , 512 , 1024 )
127- stft1 = stft1 .reshape (- 1 , 1 , 512 , 1024 )
125+ stft0 = stft0 .reshape (1 , - 1 , 512 , 1024 )
126+ stft1 = stft1 .reshape (1 , - 1 , 512 , 1024 )
128127
129- stft_01 = torch .cat ([stft0 , stft1 ], axis = 1 )
128+ stft_01 = torch .cat ([stft0 , stft1 ], axis = 0 )
130129
131130 print ("stft_01" , stft_01 .shape , stft_01 .dtype )
132131
133132 vocals_spec = vocals (stft_01 )
134133 accompaniment_spec = accompaniment (stft_01 )
135- # (num_splits, num_channels , 512, 1024)
134+ # (num_channels, num_splits , 512, 1024)
136135
137136 sum_spec = (vocals_spec .square () + accompaniment_spec .square ()) + 1e-10
138137
@@ -142,8 +141,8 @@ def main():
142141 for name , spec in zip (
143142 ["vocals" , "accompaniment" ], [vocals_spec , accompaniment_spec ]
144143 ):
145- spec_c0 = spec [:, 0 , :, : ]
146- spec_c1 = spec [:, 1 , :, : ]
144+ spec_c0 = spec [0 ]
145+ spec_c1 = spec [1 ]
147146
148147 spec_c0 = spec_c0 .reshape (- 1 , 1024 )
149148 spec_c1 = spec_c1 .reshape (- 1 , 1024 )
0 commit comments