refine basic test
This commit is contained in:
parent
84e7697c6a
commit
8ace7f0d8e
|
@ -5,16 +5,16 @@ int main() {
|
||||||
|
|
||||||
builder::Shape shape({10, 10});
|
builder::Shape shape({10, 10});
|
||||||
auto pType = builder::PrimitiveType::F32();
|
auto pType = builder::PrimitiveType::F32();
|
||||||
builder::Type type(shape, pType);
|
builder::Type OutType(shape, pType);
|
||||||
|
|
||||||
std::vector<float> data(100);
|
std::vector<float> data(100);
|
||||||
builder::Tensor tensor(shape, data);
|
builder::Tensor tensor(shape, data);
|
||||||
|
|
||||||
auto in1 = builder.CreateInput(type);
|
auto in1 = builder.CreateInput(OutType);
|
||||||
auto op1 = builder::mhlo::ConstOp::build(builder, type, tensor);
|
auto op1 = builder::mhlo::ConstOp::build(builder, OutType, tensor);
|
||||||
auto op2 = builder::mhlo::ConstOp::build(builder, type, tensor);
|
auto op2 = builder::mhlo::ConstOp::build(builder, OutType, tensor);
|
||||||
auto op3 = builder::mhlo::AddOp::build(builder, type, op1, op2);
|
auto op3 = builder::mhlo::AddOp::build(builder, OutType, op1, op2);
|
||||||
auto op4 = builder::mhlo::MulOp::build(builder, type, op3, in1);
|
auto op4 = builder::mhlo::MulOp::build(builder, OutType, op3, in1);
|
||||||
|
|
||||||
builder.SetOutput(std::vector<builder::Op>({op4}));
|
builder.SetOutput(std::vector<builder::Op>({op4}));
|
||||||
builder.DumpModule();
|
builder.DumpModule();
|
||||||
|
|
Loading…
Reference in New Issue