From fce05646d729a82a76bbc9466c8a004bdafeb724 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 27 Nov 2018 11:35:19 -0800 Subject: [PATCH] Convert tf.FusedBatchNorm into tfl primary math ops * Added TF::FusedBatchNormOp * Validated TF::FusedBatchNormOp's operands * Added converter from tf.FusedBatchNorm to tfl math ops In the converter, we additionally check that the 'is_training' attribute in tf.FusedBatchNorm is false and the last 4 outputs are all not used (true for inference). These requirements do not exist in the original TOCO source code, which just silently ignores the last 4 outputs. PiperOrigin-RevId: 223027333 --- mlir/include/mlir/IR/OpDefinition.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h index 2fa2c7e945fc..e6304dd083f4 100644 --- a/mlir/include/mlir/IR/OpDefinition.h +++ b/mlir/include/mlir/IR/OpDefinition.h @@ -537,6 +537,8 @@ public: template class Impl : public TraitBase::Impl> { public: + static unsigned getNumResults() { return N; } + const SSAValue *getResult(unsigned i) const { return this->getOperation()->getResult(i); }