Issue 1:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Google Colab

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No

TensorFlow installed from (source or binary): binary

TensorFlow version (use command below): v2.0.0-beta1-5101-gc75bb66 2.0.0-rc0

Python version: 3

Bazel version (if compiling from source): No

GCC/Compiler version (if compiling from source): No

CUDA/cuDNN version: Unknown, from Colab

GPU model and memory: Unknown, from Colab

Describe the current behavior

When i rewrote my estimator-based model (Dataset + Feature columns) to keras i was able to run (train) it.

But when i converted it to estimator as shown in migration guide https://www.tensorflow.org/beta/guide/migration_guide#estimators it fails with error

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-6538390f0054> in <module>()
1 estimator = tf.keras.estimator.model_to_estimator(
----> 2 keras_model = model
3 )

9 frames
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/autograph/impl/api.py in wrapper(*args, **kwargs)
235 except Exception as e: # pylint:disable=broad-except
236 if hasattr(e, 'ag_error_metadata'):
--> 237 raise e.ag_error_metadata.to_exception(e)
238 else:
239 raise

ValueError: in converted code:
relative to /usr/local/lib/python3.6/dist-packages/tensorflow_core/python/feature_column:

sequence_feature_column.py:140 call
transformation_cache, self._state_manager)
feature_column_v2.py:3205 get_sequence_dense_tensor
self.categorical_column))

ValueError: In embedding_column: words_embedding. categorical_column must be of type SequenceCategoricalColumn to use SequenceFeatures. Suggested fix: Use one of sequence_categorical_column_with_*. Given (type <class 'tensorflow.python.feature_column.feature_column_v2.HashedCategoricalColumn'>): HashedCategoricalColumn(key='words', hash_bucket_size=1000, dtype=tf.string)

Describe the expected behavior

Working keras model should always be convertable to estimator.

Code to reproduce the issue

Here is an example https://colab.research.google.com/drive/11pWyltRzvQPPvM2dWQ8EqxafB9ByCxNn

There are 2 cases shown. First i show that keras model with sequence features is working. See model.fit_generator.

And then i show that conversion to estimator fails.

Issue 2:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A

TensorFlow installed from (source or binary): Source

TensorFlow version (use command below): 1.8

Python version: 2.7

Bazel version (if compiling from source): 0.11.1

GCC/Compiler version (if compiling from source): gcc4.8

CUDA/cuDNN version: N/A

GPU model and memory: AMD R9 Nano

Exact command to reproduce: N/A

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.

Hi,

We are working on a SYCL implementation of TensorFlow. When implementing the backend for the scatter_nd operation we were wondering what is the behavior of concurrent updates.

The test in scatter_nd_ops_test.py assumes that the operations are applied in a non-deterministic order, which matches what the documentation says. This corner case is costly to handle on the GPU and it seems that the CUDA implementation does not handle it, neither does ours.

The documentation says:

The order in which updates are applied is nondeterministic, so the output will be nondeterministic if indices contains duplicates.

The test checks for Add and Sub of two concurrent indices to result in the total summation (or subtraction) of both updates to apply (order of additions is nondeterministic but the result is). On a replace operation the output would be nondeterministic (hence the test not checking for it).

With a non blocking GPU implementation the second update applied to an index may (and will probably) overwrite the first update from a different thread.

Our question then is:

Is the test wrong to test that concurrent summation & subtraction is deterministic (in which case we would be happy to write a PR to correct that)?

Otherwise, is the CUDA implementation wrong? In which case the documentation should probably be more descriptive on what happens with concurrent add/sub compared to replace.

Thanks,