-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add support for flow batches in flow_to_image #5308
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
Conversation
💊 CI failures summary and remediationsAs of commit a1add53 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
Job | Step | Action |
---|---|---|
curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh | ||
sh conda.sh -b | ||
source $HOME/miniconda3/bin/activate | ||
conda install -yq conda-build cmake | ||
packaging/build_cmake.sh | ||
🔁 rerun |
This comment was automatically generated by Dr. CI (expand for details).
Please report bugs/suggestions to the (internal) Dr. CI Users group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
raise ValueError(f"Input flow should have shape (2, H, W), got {flow.shape}.") | ||
orig_shape = flow.shape | ||
if flow.ndim == 3: | ||
flow = flow[None] # Add batch dim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small doubt.
Does this modify flow inplace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the 2 objects may be a view on the same underlying memory, but they're different objects
In [1]: import torch
torch.tensor
In [2]: a = torch.tensor([1, 2])
In [3]: b = a[None]
In [4]: b is a
Out[4]: False
In [5]: a, b
Out[5]: (tensor([1, 2]), tensor([[1, 2]]))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarification. Will note this.
Summary: flow bartches support. Reviewed By: kazhang Differential Revision: D33927500 fbshipit-source-id: b0cfa9f6d6ca2cb19f66a183755c488f495ece98
Follow up to #5134 and to #5091, this PR adds support for batches of flows to the
flow_to_image()
util.CC @oke-aditya