From f3dbad86bdc3486802ab166cbde8d2836dc1281e Mon Sep 17 00:00:00 2001 From: struss Date: Wed, 13 May 2020 13:42:32 +0900 Subject: [PATCH] [res/TensorFlowPythonExamples] Add one_hot operation case (#739) * This Commit will add `one_hot` operation related case. For [res/TensorFlowPythonExamples]. Signed-off-by: struss * Fix Typo on Python Example File. * Update depth, on_value, off_value as scalar type. Signed-off-by: struss --- res/TensorFlowPythonExamples/examples/one_hot/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 res/TensorFlowPythonExamples/examples/one_hot/__init__.py diff --git a/res/TensorFlowPythonExamples/examples/one_hot/__init__.py b/res/TensorFlowPythonExamples/examples/one_hot/__init__.py new file mode 100644 index 00000000000..49e0346d350 --- /dev/null +++ b/res/TensorFlowPythonExamples/examples/one_hot/__init__.py @@ -0,0 +1,8 @@ +import tensorflow as tf + +indice_ = tf.compat.v1.placeholder(tf.int32, shape=(1, 2, 3, 4), name='Hole') +depth_ = tf.compat.v1.placeholder(tf.int32, shape=(), name='Hole') +on_value_ = tf.compat.v1.placeholder(tf.int32, shape=(), name='Hole') +off_value_ = tf.compat.v1.placeholder(tf.int32, shape=(), name='Hole') +op_ = tf.one_hot( + indices=indice_, depth=depth_, on_value=on_value_, off_value=off_value_, axis=-1)