Skip to content

Commit

Permalink
[exo] Use must_cast() (Samsung#761)
Browse files Browse the repository at this point in the history
This will revise exo TFLTensorExporter with must_cast to resolve static analysis warnings

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored May 13, 2020
1 parent dcaec56 commit f876094
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/exo/src/TFLite/TFLTensorExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,24 @@ struct NoOpDetector final : public loco::CanonicalNodeMutableVisitor<bool>

bool visit(loco::FilterEncode *node) final
{
auto encoder = dynamic_cast<loco::PermutingEncoder<loco::Domain::Filter> *>(node->encoder());
auto encoder = loco::must_cast<loco::PermutingEncoder<loco::Domain::Filter> *>(node->encoder());
auto perm = encoder->perm();

return isNHWC(perm);
}

bool visit(loco::FeatureEncode *node) final
{
auto encoder = dynamic_cast<loco::PermutingEncoder<loco::Domain::Feature> *>(node->encoder());
auto encoder =
loco::must_cast<loco::PermutingEncoder<loco::Domain::Feature> *>(node->encoder());
auto perm = encoder->perm();
return isNHWC(perm);
}

bool visit(loco::FeatureDecode *node) final
{
auto decoder = dynamic_cast<loco::PermutingDecoder<loco::Domain::Feature> *>(node->decoder());
auto decoder =
loco::must_cast<loco::PermutingDecoder<loco::Domain::Feature> *>(node->decoder());
auto perm = decoder->perm();
return isNHWC(perm);
}
Expand Down

0 comments on commit f876094

Please sign in to comment.