Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Update generator_utils.py #1674

Merged
merged 1 commit into from
Aug 26, 2019
Merged

Conversation

TanguyUrvoy
Copy link
Contributor

Hi,
isinstance(v[0], six.integer_types) is False for np.int64 type causing algorithmic_sort_problem data generation to fail.

Hi,
`isinstance(v[0], six.integer_types)` is False for `np.int64` type causing algorithmic_sort_problem data generation to fail.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no PR author has not signed CLA label Aug 23, 2019
@TanguyUrvoy
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes PR author has signed CLA and removed cla: no PR author has not signed CLA labels Aug 23, 2019
@@ -48,7 +49,7 @@ def to_example(dictionary):
for (k, v) in six.iteritems(dictionary):
if not v:
raise ValueError("Empty generated field: %s" % str((k, v)))
if isinstance(v[0], six.integer_types):
if isinstance(v[0], six.integer_types) or isinstance(v[0], np.int64):
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @TanguyUrvoy for this very important fix! I'll change the above to "np.issubdtype(type(v[0]), np.integer)" since it will generalize better. Thanks!

@afrozenator
Copy link
Contributor

Many thanks @TanguyUrvoy !

@afrozenator afrozenator merged commit 7fa4b1a into tensorflow:master Aug 26, 2019
tensorflow-copybara pushed a commit that referenced this pull request Aug 26, 2019
PiperOrigin-RevId: 265525791
@TanguyUrvoy TanguyUrvoy deleted the patch-1 branch September 3, 2019 08:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants