File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ def __init__(self, ngpu):
129129
130130 def forward (self , input ):
131131 gpu_ids = None
132- if isinstance (input .data , torch .cuda .FloatTensor ) and self .ngpu > 1 :
132+ if isinstance (input .data , torch .cuda .FloatTensor ) and self .ngpu >= 1 :
133133 gpu_ids = range (self .ngpu )
134134 return nn .parallel .data_parallel (self .main , input , gpu_ids )
135135
@@ -168,7 +168,7 @@ def __init__(self, ngpu):
168168
169169 def forward (self , input ):
170170 gpu_ids = None
171- if isinstance (input .data , torch .cuda .FloatTensor ) and self .ngpu > 1 :
171+ if isinstance (input .data , torch .cuda .FloatTensor ) and self .ngpu > = 1 :
172172 gpu_ids = range (self .ngpu )
173173 output = nn .parallel .data_parallel (self .main , input , gpu_ids )
174174 return output .view (- 1 , 1 )
You can’t perform that action at this time.
0 commit comments