[res] gelu TF examples (#4046)
authorSaeHie Park <saehie.park@gmail.com>
Tue, 1 Sep 2020 06:52:16 +0000 (15:52 +0900)
committerGitHub <noreply@github.com>
Tue, 1 Sep 2020 06:52:16 +0000 (15:52 +0900)
This will add TF examples for gelu operator

ONE-DCO-1.0-Signed-off-by: SaeHie Park <saehie.park@gmail.com>

res/TensorFlowPythonExamples/examples/gelu/__init__.py [new file with mode: 0644]
res/TensorFlowPythonExamples/examples/gelu_2/__init__.py [new file with mode: 0644]

diff --git a/res/TensorFlowPythonExamples/examples/gelu/__init__.py b/res/TensorFlowPythonExamples/examples/gelu/__init__.py
new file mode 100644 (file)
index 0000000..cdc4d62
--- /dev/null
@@ -0,0 +1,7 @@
+# NOTE please use TF2.4.0-dev or above to use gelu op
+import tensorflow as tf
+
+tf.compat.v1.disable_eager_execution()
+
+in_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(4, 4), name="Hole")
+op_ = tf.nn.gelu(in_, approximate=False, name="Output")
diff --git a/res/TensorFlowPythonExamples/examples/gelu_2/__init__.py b/res/TensorFlowPythonExamples/examples/gelu_2/__init__.py
new file mode 100644 (file)
index 0000000..147688d
--- /dev/null
@@ -0,0 +1,7 @@
+# NOTE please use TF2.4.0-dev or above to use gelu op
+import tensorflow as tf
+
+tf.compat.v1.disable_eager_execution()
+
+in_ = tf.compat.v1.placeholder(dtype=tf.float32, shape=(4, 4), name="Hole")
+op_ = tf.nn.gelu(in_, approximate=True, name="Output")