• lgulich's avatar
    Fixes configclass dict conversion for torch tensors (#1530) · c9f6ac57
    lgulich authored
    # Description
    
    Fix configclass dict conversion for torch tensors
    
    Up to v1.2.0 if a configclass would contain a list/tuple of torch
    tensors it would be left as is.
    
    \#1227 changed the behavior of converting lists/tuples in a dict, which
    means that currently torch tensors are converted to an empty dict,
    effectively losing all contained data.
    
    The underlying issue is that `torch.tensor.__dict__` returns an empty
    dict, which was (luckily) ignored previously because we did not convert
    the contents of lists.
    
    This MR fixes this by treating torch tensors specially. I don't like
    having a special case for a non-builtin class but given that
    IsaacLab is heavily married with torch tensors I think it's ok in this
    case.
    
    Since currently the behavior is different between 1.2 and 1.3: can we
    cherry pick this change to the 1.3 branch?
    
    ## Type of change
    
    - Bug fix (non-breaking change which fixes an issue)
    
    ## Checklist
    
    - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
    `./isaaclab.sh --format`
    - [ ] I have made corresponding changes to the documentation
    - [x] My changes generate no new warnings
    - [x] I have added tests that prove my fix is effective or that my
    feature works
    - [x] I have updated the changelog and the corresponding version in the
    extension's `config/extension.toml` file
    - [x] I have added my name to the `CONTRIBUTORS.md` or my name already
    exists there
    Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
    c9f6ac57
Name
Last commit
Last update
.aws Loading commit data...
.github Loading commit data...
.vscode Loading commit data...
docker Loading commit data...
docs Loading commit data...
source Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.flake8 Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.pre-commit-config.yaml Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
isaaclab.bat Loading commit data...
isaaclab.sh Loading commit data...
pyproject.toml Loading commit data...