Support Log in TFLite/MLIR converter

PiperOrigin-RevId: 272076492
This commit is contained in:
Yu-Cheng Ling 2019-09-30 15:15:11 -07:00 committed by TensorFlower Gardener
parent 9a868ea56c
commit 964ee5e31d
2 changed files with 8 additions and 0 deletions

View File

@ -232,6 +232,13 @@ func @square(%arg0: tensor<8x16xf32>) -> tensor<8x16xf32> {
// CHECK: %0 = "tfl.square"(%arg0) : (tensor<8x16xf32>) -> tensor<8x16xf32>
}
func @log(%arg0: tensor<8x16xf32>) -> tensor<8x16xf32> {
%0 = "tf.Log"(%arg0) : (tensor<8x16xf32>) -> tensor<8x16xf32>
return %0 : tensor<8x16xf32>
// CHECK-LABEL: log
// CHECK: %0 = "tfl.log"(%arg0) : (tensor<8x16xf32>) -> tensor<8x16xf32>
}
func @log_softmax(%arg0: tensor<8x16xf32>) -> tensor<8x16xf32> {
%0 = "tf.LogSoftmax"(%arg0) : (tensor<8x16xf32>) -> tensor<8x16xf32>
return %0 : tensor<8x16xf32>

View File

@ -105,6 +105,7 @@ def : Pat<(TF_FillOp $arg, $value), (TFL_FillOp $arg, $value)>;
def : Pat<(TF_FloorOp $arg), (TFL_FloorOp $arg)>;
def : Pat<(TF_LeakyReluOp $arg, F32Attr:$a), (TFL_LeakyReluOp $arg, $a)>;
def : Pat<(TF_LogOp $arg), (TFL_LogOp $arg)>;
def : Pat<(TF_LogicalNotOp $arg), (TFL_LogicalNotOp $arg)>;
def : Pat<(TF_LogSoftmaxOp $arg), (TFL_LogSoftmaxOp $arg)>;