Skip to content

Conversation

@yuecideng
Copy link
Contributor

@yuecideng yuecideng commented Feb 9, 2026

Description

Add support for automatic obs space conversion from torch tensor.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

Copilot AI review requested due to automatic review settings February 9, 2026 13:46
@yuecideng yuecideng added bug Something isn't working gym robot learning env and its related features labels Feb 9, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to fix BaseEnv observation space creation when initial observations are torch tensors by adding automatic conversion from torch.Tensor to gymnasium.spaces.Box.

Changes:

  • Add torch.Tensor handling to convert_observation_to_space() to infer shape, dtype, and bounds.
  • Introduce torch→NumPy dtype mapping logic for Box space construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yuecideng yuecideng merged commit 4013ed1 into main Feb 9, 2026
5 checks passed
@yuecideng yuecideng deleted the yueci/fix-obs-space branch February 9, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gym robot learning env and its related features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant