提交 c66037dd 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

Make unfold-batch-matmul into a command line option for the tfl-prepare-tf pass

PiperOrigin-RevId: 328319683
Change-Id: I674a6c0d789058737df9adaadebed5a56dfc21c1
上级 d3cdaddd
......@@ -80,9 +80,11 @@ namespace {
// Prepare TF operations in functions for subsequent legalization.
class PrepareTFPass : public PassWrapper<PrepareTFPass, FunctionPass> {
public:
explicit PrepareTFPass() : unfold_batch_matmul_(true) {}
explicit PrepareTFPass(bool unfold_batch_matmul)
: unfold_batch_matmul_(unfold_batch_matmul) {}
PrepareTFPass() = default;
PrepareTFPass(const PrepareTFPass &) {}
explicit PrepareTFPass(bool unfold_batch_matmul) {
unfold_batch_matmul_ = unfold_batch_matmul;
}
void runOnFunction() override;
void getDependentDialects(DialectRegistry &registry) const override {
......@@ -91,7 +93,10 @@ class PrepareTFPass : public PassWrapper<PrepareTFPass, FunctionPass> {
}
private:
bool unfold_batch_matmul_;
Option<bool> unfold_batch_matmul_{
*this, "tfl-unfold-batch-matmul",
llvm::cl::desc("Unfold BatchMatMul into individual MatMul ops."),
llvm::cl::init(true)};
};
template <class TFFakeQuantOp>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册