Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addressing Torchscript compatibility #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SergeySandler
Copy link

@SergeySandler SergeySandler commented Mar 8, 2024

Making the code torch.jit.script() friendly; torch.jit.trace() is also supported.
See issues/83.

Making the code torch.jit.script() friendly; torch.jit.trace() is also supported.
Copy link

google-cla bot commented Mar 8, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Comment on lines +211 to +214
out = (torch.mean(torch.stack(trajectories.occlusion[p::p]), dim=0),
torch.mean(torch.stack(trajectories.tracks[p::p]), dim=0),
torch.mean(torch.stack(trajectories.expected_dist[p::p]), dim=0)
)
Copy link
Author

Choose a reason for hiding this comment

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

If there is a use case to return unrefined_occlusion, unrefined_tracks and unrefined_expected_dist then the code should be modified as

    out = (torch.mean(torch.stack(trajectories.occlusion[p::p]), dim=0),       # occlusion
           torch.mean(torch.stack(trajectories.tracks[p::p]), dim=0),          # tracks
           torch.mean(torch.stack(trajectories.expected_dist[p::p]), dim=0),   # expected_dist
           trajectories.occlusion[:-1],                                        # unrefined_occlusion
           trajectories.tracks[:-1],                                           # unrefined_tracks
           trajectories.expected_dist[:-1]                                     # unrefined_expected_dist        
          )

having -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: replaced with -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, list[torch.Tensor], list[torch.Tensor], list[torch.Tensor]]: in the forward annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant