• 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
..
omni.isaac.lab Loading commit data...
omni.isaac.lab_assets Loading commit data...
omni.isaac.lab_tasks Loading commit data...