File tree 7 files changed +8
-8
lines changed
7 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ def __init__(
323
323
try :
324
324
device = next (self .parameters ()).device
325
325
except AttributeError :
326
- device = torch .device ("cpu" )
326
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
327
327
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
328
328
if bool (min_alpha ) ^ bool (max_alpha ):
329
329
min_alpha = min_alpha if min_alpha else 0.0
Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ def __init__(
306
306
try :
307
307
device = next (self .parameters ()).device
308
308
except AttributeError :
309
- device = torch .device ("cpu" )
309
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
310
310
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
311
311
if bool (min_alpha ) ^ bool (max_alpha ):
312
312
min_alpha = min_alpha if min_alpha else 0.0
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ def __init__(
103
103
try :
104
104
device = next (self .parameters ()).device
105
105
except AttributeError :
106
- device = torch .device ("cpu" )
106
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
107
107
108
108
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
109
109
if bool (min_alpha ) ^ bool (max_alpha ):
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ def __init__(
203
203
try :
204
204
device = next (self .parameters ()).device
205
205
except AttributeError :
206
- device = torch .device ("cpu" )
206
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
207
207
208
208
self .register_buffer ("alpha_init" , torch .as_tensor (alpha_init , device = device ))
209
209
self .register_buffer (
Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ def __init__(
387
387
try :
388
388
device = next (self .parameters ()).device
389
389
except (AttributeError , StopIteration ):
390
- device = torch .device ("cpu" )
390
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
391
391
392
392
self .register_buffer ("entropy_coef" , torch .tensor (entropy_coef , device = device ))
393
393
if critic_coef is not None :
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ def __init__(
319
319
try :
320
320
device = next (self .parameters ()).device
321
321
except AttributeError :
322
- device = torch .device ("cpu" )
322
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
323
323
324
324
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
325
325
self .register_buffer (
Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ def __init__(
393
393
try :
394
394
device = next (self .parameters ()).device
395
395
except AttributeError :
396
- device = torch .device ("cpu" )
396
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
397
397
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
398
398
if bool (min_alpha ) ^ bool (max_alpha ):
399
399
min_alpha = min_alpha if min_alpha else 0.0
@@ -1119,7 +1119,7 @@ def __init__(
1119
1119
try :
1120
1120
device = next (self .parameters ()).device
1121
1121
except AttributeError :
1122
- device = torch .device ("cpu" )
1122
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
1123
1123
1124
1124
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
1125
1125
if bool (min_alpha ) ^ bool (max_alpha ):
You can’t perform that action at this time.
0 commit comments