Skip to content

Commit

Permalink
revert unecessary update
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzhang1130 authored May 22, 2024
1 parent b0ab6f2 commit ca2780d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/game_gomoku/code/board_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
EMPTY_PIECE = "0"


def board2img(board: np.ndarray, output_dir: str) -> str:
def board2img(board: np.ndarray, save_path: str) -> str:
"""Convert the board to an image and save it to the specified path."""

size = board.shape[0]
Expand Down Expand Up @@ -63,9 +63,9 @@ def board2img(board: np.ndarray, output_dir: str) -> str:
ax.set_xticklabels(range(size))
ax.set_yticklabels(range(size))
ax.invert_yaxis()
plt.savefig(output_dir, bbox_inches="tight", pad_inches=0.1)
plt.savefig(save_path, bbox_inches="tight", pad_inches=0.1)
plt.close(fig) # Close the figure to free memory
return output_dir
return save_path


class BoardAgent(AgentBase):
Expand Down

0 comments on commit ca2780d

Please sign in to comment.