Equim-chan / Mortal

🚀🀄️ A fast and strong AI for riichi mahjong, powered by Rust and deep reinforcement learning.
https://mortal.ekyu.moe
GNU Affero General Public License v3.0
1k stars 130 forks source link

Fix: add torch.device wrapper and error message for empty gameplay file #7

Closed wongsingfo closed 2 years ago

wongsingfo commented 2 years ago

This PR resolves two runtime errors during the training process:

  1. Add torch.device wrapper on device name. Without this wrapper, a confusing error "RuntimeError: failed to execute react_batch on Python engine" occurs.
  2. Add friendly error message for empty gameplay file. Without this fix, rust panics with "index out of range".