MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateShapePairs

Function CreateShapePairs

tensorflow/lite/toco/tooling_util_test.cc:37–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37std::vector<ShapePair> CreateShapePairs() {
38 return std::vector<ShapePair>(
39 {// These agree up to broadcast.
40 {Shape({3}), Shape({3}), Agreement::kBroadcast},
41 {Shape({256, 256, 3}), Shape({256, 256, 3}), Agreement::kBroadcast},
42 {Shape({256, 256, 3}), Shape({3}), Agreement::kBroadcast},
43 {Shape({8, 1, 6, 1}), Shape({7, 1, 5}), Agreement::kBroadcast},
44 {Shape({}), Shape({3}), Agreement::kBroadcast},
45 {Shape({}), Shape({3, 1}), Agreement::kBroadcast},
46
47 // These extend (and therefore broadcast).
48 {Shape({3}), Shape({3}), Agreement::kExtend},
49 {Shape({256, 256, 3}), Shape({256, 256, 3}), Agreement::kExtend},
50 {Shape({1, 1, 3}), Shape({1, 1, 3}), Agreement::kExtend},
51 {Shape({1, 1, 3}), Shape({3}), Agreement::kExtend},
52 {Shape({1, 1, 3}), Shape({1, 3}), Agreement::kExtend},
53
54 // These strictly broadcast and do not extend.
55 {Shape({256, 256, 3}), Shape({3}), Agreement::kBroadcastNotExtend},
56 {Shape({5, 4}), Shape({1}), Agreement::kBroadcastNotExtend},
57 {Shape({5, 4}), Shape({4}), Agreement::kBroadcastNotExtend},
58 {Shape({15, 3, 5}), Shape({15, 1, 5}), Agreement::kBroadcastNotExtend},
59 {Shape({15, 3, 5}), Shape({3, 5}), Agreement::kBroadcastNotExtend},
60 {Shape({15, 3, 5}), Shape({3, 1}), Agreement::kBroadcastNotExtend},
61 {Shape({3, 1}), Shape({}), Agreement::kBroadcastNotExtend},
62
63 // These do not broadcast (and therefore also do not extend).
64 {Shape({3}), Shape({4}), Agreement::kNeither},
65 {Shape({2, 1}), Shape({8, 4, 3}), Agreement::kNeither}});
66}
67
68// ShapeTest is an empty parameterized test fixture since there is no state.
69class ShapeTest : public ::testing::TestWithParam<ShapePair> {};

Callers 1

Calls 1

ShapeClass · 0.70

Tested by

no test coverage detected