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

Added examples to tf.clip_by_value #29774

Merged
merged 4 commits into from Jun 25, 2019
Merged

Conversation

jvishnuvardhan
Copy link
Contributor

No description provided.

@tensorflow-bot tensorflow-bot bot added the size:S CL Change Size: Small label Jun 14, 2019
@gbaned gbaned self-assigned this Jun 14, 2019
@gbaned gbaned added the comp:ops OPs related issues label Jun 14, 2019
@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Jun 14, 2019
@gbaned gbaned requested a review from alextp June 14, 2019 04:48
For example:

```python
A=tf.constant([[1,20,13],[3,21,13]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the code be updated to be compatible with TF style? This means space around = used for assignment, space after commas, etc

A=tf.constant([[1,20,13],[3,21,13]])
B=tf.clip_by_value(A, clip_value_min=0, clip_value_max=3) #[[1, 3, 3],[3, 3, 3]]
C=tf.clip_by_value(A, clip_value_min=0., clip_value_max=3.)
# throws `TypeError` as input and clip_values are of different dtype
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment on a different line is not obvious; either put it before or just elide this altogether

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @alextp. Updated according to your suggestion.

B=tf.clip_by_value(A, clip_value_min=0, clip_value_max=3) #[[1, 3, 3],[3, 3, 3]]
C=tf.clip_by_value(A, clip_value_min=0., clip_value_max=3.)
# throws `TypeError` as input and clip_values are of different dtype
D=tf.constant([2.0,3.1,5.3])
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what value this third example is adding

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed third example. Thanks!

PR Queue automation moved this from Assigned Reviewer to Reviewer Requested Changes Jun 14, 2019
alextp
alextp previously approved these changes Jun 14, 2019
@tensorflow-bot tensorflow-bot bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jun 14, 2019
PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Jun 14, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jun 14, 2019
@gbaned
Copy link
Contributor

gbaned commented Jun 17, 2019

@jvishnuvardhan Can you please check Ubuntu Sanity errors? Thanks!

PR Queue automation moved this from Approved by Reviewer to Reviewer Requested Changes Jun 20, 2019
alextp
alextp previously approved these changes Jun 20, 2019
@tensorflow-bot tensorflow-bot bot added the kokoro:force-run Tests on submitted change label Jun 20, 2019
PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Jun 20, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jun 20, 2019
Updated to clear sanity checks
PR Queue automation moved this from Approved by Reviewer to Reviewer Requested Changes Jun 20, 2019
@rthadur rthadur requested a review from alextp June 24, 2019 22:38
PR Queue automation moved this from Reviewer Requested Changes to Approved by Reviewer Jun 24, 2019
@tensorflow-bot tensorflow-bot bot added the kokoro:force-run Tests on submitted change label Jun 24, 2019
@kokoro-team kokoro-team removed kokoro:force-run Tests on submitted change labels Jun 24, 2019
pull bot pushed a commit to Cache-Cloud/tensorflow that referenced this pull request Jun 25, 2019
@tensorflow-copybara tensorflow-copybara merged commit 8c4972b into master Jun 25, 2019
PR Queue automation moved this from Approved by Reviewer to Merged Jun 25, 2019
@jvishnuvardhan jvishnuvardhan deleted the jvishnuvardhan-patch-8 branch June 25, 2019 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:ops OPs related issues ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants