-
Notifications
You must be signed in to change notification settings - Fork 83
Support all tf types #346
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
Merged
Merged
Support all tf types #346
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
cb26531
support and test for all tf tests
NihalHarish 577d50f
conditionally support custom tf types
NihalHarish 92dc42b
check type
NihalHarish 8323127
raise exception if fail
NihalHarish 3258649
type conversion
NihalHarish 490e478
check tf version
NihalHarish 54d68c0
test commit
NihalHarish 34c6452
Revert "test commit"
NihalHarish 97f0ed2
Revert "check tf version"
NihalHarish 32fd9f2
check tf version
NihalHarish 6086692
update dtypes only for tf2
NihalHarish 8092f28
change dict key check
NihalHarish 9a7d19c
test commit
NihalHarish aa2ea2d
Revert "test commit"
NihalHarish 9157486
test commit
NihalHarish 44ebad9
Revert "test commit"
NihalHarish 57bdce6
revert file
NihalHarish 6c62f50
update dict
NihalHarish bf22f80
if check
NihalHarish c31cb37
bfloat
NihalHarish dc57bb0
version import:
NihalHarish bf7462b
remove bfloat
NihalHarish fe3867e
correct import
NihalHarish 0c09d16
remove bfloat
NihalHarish 908e6ab
bfloat
NihalHarish 221de7d
retrigger CI
NihalHarish aef883c
retrigger CI
NihalHarish 199871f
retrigger CI
NihalHarish 59a1d54
retrigger CI
NihalHarish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Third Party | ||
| import numpy as np | ||
| from packaging import version | ||
| from tensorflow.python.framework.dtypes import _NP_TO_TF | ||
|
|
||
| # First Party | ||
| from smdebug.core.tfevent.util import _get_proto_dtype | ||
|
|
||
|
|
||
| def test_tensorflow2_datatypes(): | ||
| # _NP_TO_TF contains all the mappings | ||
| # of numpy to tf types | ||
| try: | ||
| from tensorflow import __version__ as tf_version | ||
|
|
||
| if version.parse(tf_version) >= version.parse("2.0.0"): | ||
| from tensorflow.python import _pywrap_bfloat16 | ||
|
|
||
| # TF 2.x.x Implements a Custom Numpy Datatype for Brain Floating Type | ||
| # Which is currently only supported on TPUs | ||
| _np_bfloat16 = _pywrap_bfloat16.TF_bfloat16_type() | ||
| _NP_TO_TF.pop(_np_bfloat16) | ||
| except (ModuleNotFoundError, ValueError, ImportError): | ||
| pass | ||
|
|
||
| for _type in _NP_TO_TF: | ||
| try: | ||
| _get_proto_dtype(np.dtype(_type)) | ||
| except Exception: | ||
| assert False | ||
| assert True | ||
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.
Uh oh!
There was an error while loading. Please reload this page.