File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -152,10 +152,8 @@ def __init__(self, ngpu):
152
152
153
153
def forward (self , input ):
154
154
155
- if input .is_cuda and self .ngpu > 1 :
155
+ if ( input .is_cuda or input . is_xpu ) and self .ngpu > 1 :
156
156
output = nn .parallel .data_parallel (self .main , input , range (self .ngpu ))
157
- if input .is_xpu and self .ngpu > 1 :
158
- output = nn .DataParallel (self .main , input , range (self .ngpu ))
159
157
else :
160
158
output = self .main (input )
161
159
return output
@@ -194,10 +192,8 @@ def __init__(self, ngpu):
194
192
)
195
193
196
194
def forward (self , input ):
197
- if input .is_cuda and self .ngpu > 1 :
195
+ if ( input .is_cuda or input . is_xpu ) and self .ngpu > 1 :
198
196
output = nn .parallel .data_parallel (self .main , input , range (self .ngpu ))
199
- if input .is_xpu and self .ngpu > 1 :
200
- output = nn .DataParallel (self .main , input , range (self .ngpu ))
201
197
else :
202
198
output = self .main (input )
203
199
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ case $USE_CUDA in
58
58
esac
59
59
60
60
function dcgan() {
61
- uv run main.py --dataset fake --accel --dry-run || error " dcgan failed"
61
+ uv run main.py --dataset fake $ACCEL_FLAG --dry-run || error " dcgan failed"
62
62
}
63
63
64
64
function fast_neural_style() {
You can’t perform that action at this time.
0 commit comments