Add missing mlir_passthrough_op in pip wheel install

While trying to following the example of MlirPassthroughOp in the docstring
(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/api_def/base_api/api_def_MlirPassthroughOp.pbtxt):

```python
import tensorflow as tf
from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op

mlir_module = '''python
func @main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
   %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
   return %ret : tensor<10x10xf32>
}
'''

@tf.function
def foo(x, y):
  return mlir_passthrough_op([x, y], mlir_module, Toutputs=[tf.float32])

graph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def()
```

The following error occurs in tf-nightly:
```
>>> from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow.compiler.mlir'
>>>
>>>
```

The reason was that dependency `"//tensorflow/compiler/mlir/tensorflow:gen_mlir_passthrough_op_py"`
was not included in pip.

This PR fixes the issue.

This PR is more or less related to 38894, which fixes a typo in docstring itself.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2020-04-26 15:08:03 +00:00
parent 634c902f4a
commit 1d698878c2

View File

@ -95,6 +95,7 @@ COMMON_PIP_DEPS = [
"//tensorflow:tensorflow_py",
"//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_hdrs",
"//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_srcs",
"//tensorflow/compiler/mlir/tensorflow:gen_mlir_passthrough_op_py",
"//tensorflow/core:protos_all_proto_srcs",
"//tensorflow/examples/saved_model/integration_tests:mnist_util",
"//tensorflow/lite/python/testdata:interpreter_test_data",