try to work with ROCKm (AMD) GPUs again
This commit is contained in:
@@ -536,7 +536,8 @@ class RealtimeRLCOBTrader:
|
||||
features_tensor = torch.from_numpy(features).unsqueeze(0).to(self.device)
|
||||
|
||||
with torch.no_grad():
|
||||
with torch.amp.autocast('cuda'):
|
||||
device_type = 'cuda' if self.device.type == 'cuda' else 'cpu'
|
||||
with torch.amp.autocast(device_type, enabled=device_type != 'cpu'):
|
||||
outputs = model(features_tensor)
|
||||
|
||||
# Extract predictions
|
||||
@@ -934,7 +935,8 @@ class RealtimeRLCOBTrader:
|
||||
], dtype=torch.float32).to(self.device)
|
||||
|
||||
# Forward pass with mixed precision
|
||||
with torch.amp.autocast('cuda'):
|
||||
device_type = 'cuda' if self.device.type == 'cuda' else 'cpu'
|
||||
with torch.amp.autocast(device_type, enabled=device_type != 'cpu'):
|
||||
outputs = model(features)
|
||||
|
||||
# Calculate losses
|
||||
|
||||
Reference in New Issue
Block a user