-
Notifications
You must be signed in to change notification settings - Fork 19.6k
Updated random_grayscale.py compute_output_spec #21312
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
Corrected indentation in doc string
Fixed issue with passing a single image without batch dimension.
…scale.py Co-authored-by: Jyotinder Singh <33001894+JyotinderSingh@users.noreply.github.com>
Test case for unbatched inputs
Testcase for checking both unbatched and batched single image inputs.
There was a bug, and it was causing cycle in graph.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #21312 +/- ##
=======================================
Coverage 82.60% 82.60%
=======================================
Files 565 565
Lines 54772 54773 +1
Branches 8508 8508
=======================================
+ Hits 45243 45244 +1
Misses 7439 7439
Partials 2090 2090
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 the fix!
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!
Looks like I don't have write access either |
@@ -96,7 +97,12 @@ def compute_output_shape(self, input_shape): | |||
return input_shape | |||
|
|||
def compute_output_spec(self, inputs, **kwargs): | |||
return inputs | |||
return tree.map_structure( |
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.
There should not be a tree.map_structure
in this case, there is a single input tensor.
Fixes #21268: Updates
compute_output_spec
inrandom_grayscale.py
to prevent a computation graph cycle error whenRandomGrayscale
is used as part of a custom image augmentation pipeline.