File tree Expand file tree Collapse file tree 7 files changed +8
-8
lines changed Expand file tree Collapse file tree 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 @@ -195,7 +195,7 @@ def __init__(
195
195
try :
196
196
device = next (self .parameters ()).device
197
197
except AttributeError :
198
- device = torch .device ("cpu" )
198
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
199
199
200
200
self .register_buffer ("alpha_init" , torch .as_tensor (alpha_init , device = device ))
201
201
self .register_buffer (
Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ def __init__(
388
388
try :
389
389
device = next (self .parameters ()).device
390
390
except (AttributeError , StopIteration ):
391
- device = torch .device ("cpu" )
391
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
392
392
393
393
self .register_buffer ("entropy_coef" , torch .tensor (entropy_coef , device = device ))
394
394
if critic_coef is not None :
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ def __init__(
318
318
try :
319
319
device = next (self .parameters ()).device
320
320
except AttributeError :
321
- device = torch .device ("cpu" )
321
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
322
322
323
323
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
324
324
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