MCPcopy Create free account
hub / github.com/Samsung/ONE / TEST

Function TEST

compiler/loco/src/Service/CanonicalShapeInferenceRule.test.cpp:26–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include <gtest/gtest.h>
25
26TEST(CanonicalShapeInferenceRuleTest, minimal)
27{
28 // Create a simple identity network, which takes Tensor<1x2x3x4> as input.
29 GraphTestcase<GraphCode::Identity> testcase{1, 2, 3, 4};
30
31 // Run Inference
32 loco::CanonicalShapeInferenceRule rule;
33
34 loco::apply(&rule).to(testcase.graph());
35
36 // Verify!
37 ASSERT_TRUE(loco::shape_known(testcase.push_node));
38 ASSERT_EQ(loco::Domain::Tensor, loco::shape_get(testcase.push_node).domain());
39 ASSERT_EQ(4, loco::shape_get(testcase.push_node).as<loco::TensorShape>().rank());
40 ASSERT_EQ(1, loco::shape_get(testcase.push_node).as<loco::TensorShape>().dim(0));
41 ASSERT_EQ(2, loco::shape_get(testcase.push_node).as<loco::TensorShape>().dim(1));
42 ASSERT_EQ(3, loco::shape_get(testcase.push_node).as<loco::TensorShape>().dim(2));
43 ASSERT_EQ(4, loco::shape_get(testcase.push_node).as<loco::TensorShape>().dim(3));
44}
45
46TEST(CanonicalShapeInferenceRuleTest, const_gen)
47{

Callers

nothing calls this directly

Calls 15

mappingMethod · 0.80
applyFunction · 0.50
shape_knownFunction · 0.50
shape_getFunction · 0.50
make_graphFunction · 0.50
toMethod · 0.45
graphMethod · 0.45
rankMethod · 0.45
dimMethod · 0.45
dtypeMethod · 0.45
shapeMethod · 0.45
encoderMethod · 0.45

Tested by

no test coverage detected