addons icon indicating copy to clipboard operation
addons copied to clipboard

skip_gram_op fails when batch_size is provided

Open neozwu opened this issue 5 years ago • 2 comments

The python code for skip_gram_op calls "tf.train.batch", which doesn't exist for TF2 (https://github.com/tensorflow/addons/blob/master/tensorflow_addons/text/skip_gram_ops.py#L204). Note that the current tests don't test the batch_size argument, so is missing this scenario.

neozwu avatar May 04 '21 17:05 neozwu

Thanks, Can you send a small PR?

bhack avatar May 04 '21 18:05 bhack

Looks like it would be slightly more involved than simply changing the symbol. I'm not super familiar with the testing framework, but it seems the tests are set up in eager mode (https://github.com/tensorflow/addons/blob/master/tensorflow_addons/text/tests/skip_gram_ops_test.py). If the code wants to support batch_size (ie. tf.compat.v1.train.batch), it seems the tests need to be rewritten in graph mode. Any thoughts and pointers ?

neozwu avatar May 04 '21 18:05 neozwu