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 @@ -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 @@ -376,7 +376,7 @@ def __init__(
376
376
try :
377
377
device = next (self .parameters ()).device
378
378
except (AttributeError , StopIteration ):
379
- device = torch .device ("cpu" )
379
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
380
380
381
381
self .register_buffer ("entropy_coef" , torch .tensor (entropy_coef , device = device ))
382
382
if critic_coef is not None :
Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ def __init__(
309
309
try :
310
310
device = next (self .parameters ()).device
311
311
except AttributeError :
312
- device = torch .device ("cpu" )
312
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
313
313
314
314
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
315
315
self .register_buffer (
Original file line number Diff line number Diff line change @@ -383,7 +383,7 @@ def __init__(
383
383
try :
384
384
device = next (self .parameters ()).device
385
385
except AttributeError :
386
- device = torch .device ("cpu" )
386
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
387
387
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
388
388
if bool (min_alpha ) ^ bool (max_alpha ):
389
389
min_alpha = min_alpha if min_alpha else 0.0
@@ -1102,7 +1102,7 @@ def __init__(
1102
1102
try :
1103
1103
device = next (self .parameters ()).device
1104
1104
except AttributeError :
1105
- device = torch .device ("cpu" )
1105
+ device = getattr ( torch , "get_default_device" , lambda : torch .device ("cpu" ))( )
1106
1106
1107
1107
self .register_buffer ("alpha_init" , torch .tensor (alpha_init , device = device ))
1108
1108
if bool (min_alpha ) ^ bool (max_alpha ):
You can’t perform that action at this time.
0 commit comments