[FBCode->GH] Add ops-cpp target to torchvision #3350
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
This diff adds a new target to torchvision which enables users to use torchvision ops from C++.
For now, the
cpp_library
is not used by thepython_cpp_library
. We should instead refactor the logic in torchvision to directly usecpp_library
instead.There is currently an inconsistency between fbcode and OSS users. OSS users can import torchvision via
while fbcode users need to do
It would be good to fix this discrepancy in the future.
I didn't directly use
test_frcnn_tracing.cpp
due to complications for getting the.pt
file in a way that works for both OSS and fbcode, so instead we added a self-contained test that should validate that the torchvision ops are properly registered and visible to JITReviewed By: @datumbox
Differential Revision: D26225669
fbshipit-source-id: 5dd9fb98dd58e854f95806e4860d02f54fc04ea4