-
Louis LE LAY authored
# Description This PR removes a `UserWarning` from PyTorch about using `torch.tensor()` on an existing tensor in `events.py`. It replaces `torch.tensor(actuator.joint_indices, device=asset.device)` with `.to(device)` to avoid unnecessary copies. Warning mentionned: ```bash /home/spring/IsaacLab/source/isaaclab/isaaclab/envs/mdp/events.py:542: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor). actuator_joint_indices = torch.tensor(actuator.joint_indices, device=asset.device) ``` ## 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 - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] 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 --------- Signed-off-by:
Louis LE LAY <le.lay.louis@gmail.com>
Co-authored-by:
ooctipus <zhengyuz@nvidia.com>
Co-authored-by:
Mayank Mittal <12863862+Mayankm96@users.noreply.github.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| isaaclab | ||
| isaaclab_assets | ||
| isaaclab_mimic | ||
| isaaclab_rl | ||
| isaaclab_tasks |