change printed log's level

This commit is contained in:
huanghui 2021-10-15 15:49:08 +08:00
parent 7af5de83e8
commit 3785b6d1b4
2 changed files with 23 additions and 2 deletions

View File

@ -235,7 +235,7 @@ void ProtoExporter::SetValueToProto(const ValuePtr &val, irpb::ValueProto *value
value_proto->set_dtype(irpb::DT_TYPE);
value_proto->mutable_type_val()->set_data_type(irpb::DT_BASE_COMPLEX);
} else {
MS_LOG(WARNING) << "Unsupported type " << val->type_name();
MS_LOG(DEBUG) << "Unsupported type " << val->type_name();
}
}
@ -471,7 +471,7 @@ void ProtoExporter::ExportCNode(const FuncGraphPtr &func_graph, const CNodePtr &
// CNode/ConstGraph/Const/Parameter
if (op->isa<CNode>() || IsValueNode<FuncGraph>(op) || op->isa<Parameter>()) {
MS_LOG(WARNING) << "Operator must be a primitive";
MS_LOG(DEBUG) << "Operator must be a primitive";
} else {
GetOpNodeTypeAndAttrs(func_graph, op, node_proto);
node_proto->set_name(std::to_string(apply_idx));

View File

@ -17,6 +17,7 @@ import numpy as np
import mindspore.context as context
import mindspore.ops.composite as C
from mindspore import Tensor, Parameter
from mindspore import nn
from mindspore.nn import Cell
from mindspore.ops import operations as P
@ -312,3 +313,23 @@ def test_pass_args_by_key_ward_way():
grad_net = GradNet(net)
sens = Tensor(np.ones((3, 3, 4), np.float32))
grad_net(x, y=y, z=z, sens=sens)
def test_none_input():
"""
Feature: Net's inputs
Description: Support none input for the outermost net
Expectation: no error
"""
class Net(Cell):
def __init__(self):
super(Net, self).__init__()
self.op = nn.ResizeBilinear()
def construct(self, a, b, c, d):
return self.op(a, b, c, d)
x = Tensor(np.array([1, 2, 3, 4]).astype(np.float32).reshape((1, 1, 2, 2,)))
net = Net()
net(x, (4, 4), None, True)