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):
152152
153153 def forward (self , input ):
154154
155- if input .is_cuda and self .ngpu > 1 :
155+ if ( input .is_cuda or input . is_xpu ) and self .ngpu > 1 :
156156 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 ))
159157 else :
160158 output = self .main (input )
161159 return output
@@ -194,10 +192,8 @@ def __init__(self, ngpu):
194192 )
195193
196194 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 :
198196 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 ))
201197 else :
202198 output = self .main (input )
203199
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ case $USE_CUDA in
5858esac
5959
6060function 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"
6262}
6363
6464function fast_neural_style() {
You can’t perform that action at this time.
0 commit comments