Skip to content

Commit

Permalink
Force data types for TF compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Feryal committed Jul 10, 2018
1 parent aaaf377 commit c38c0bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion craft.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def features(self):
assert len(features) == self.world.n_features
self._cached_features = features

return self._cached_features
return self._cached_features.astype(np.float32)

def step(self, action):
x, y = self.pos
Expand Down
2 changes: 1 addition & 1 deletion env.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def step(self, action, num_steps=1):
state_reward, self._current_state = self._current_state.step(action)

done = self._isDone()
reward = self._getReward() + state_reward
reward = np.float32(self._getReward() + state_reward)

if done:
self.reset()
Expand Down

0 comments on commit c38c0bb

Please sign in to comment.