提交 e60cf089 编写于 作者: R Rahul Joshi 提交者: TensorFlower Gardener

[NFC] Re-instate use of FuncOp::isPublic()

PiperOrigin-RevId: 317774876
Change-Id: I6a832236377d403b1ebd24ecbc26025c37dc1c13
上级 4d13d641
......@@ -232,22 +232,19 @@ static LogicalResult VerifySavedModelModule(
for (auto func : module.getOps<FuncOp>()) {
const bool is_exported = IsExported(func);
if (is_exported && func.getVisibility() != FuncOp::Visibility::Public) {
if (is_exported && !func.isPublic()) {
return func.emitError()
<< "exported function @" << func.getName() << " should be public";
}
if (!is_exported && func.getVisibility() == FuncOp::Visibility::Public) {
if (!is_exported && func.isPublic()) {
return func.emitError() << "non-exported function @" << func.getName()
<< " should be private";
}
if (HasAnyTfSavedModelArgAttr(func)) {
if (!is_exported) {
return func.emitError()
<< "can only apply 'tf_saved_model' argument attributes "
"to exported functions";
}
if (!is_exported && HasAnyTfSavedModelArgAttr(func)) {
return func.emitError() << "can only apply 'tf_saved_model' argument "
"attributes to exported functions";
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册