Skip to content

Commit

Permalink
[luci/service] Fix to follow clang format
Browse files Browse the repository at this point in the history
This commit fixes some line to follow clang format.

ONE-DCO-1.0-Signed-off-by: Chansu Park <1265pcs@gmail.com>
  • Loading branch information
pcs1265 committed Sep 8, 2024
1 parent c4f11fd commit 4a2ec33
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
3 changes: 0 additions & 3 deletions compiler/luci/service/src/CircleShapeInferenceRule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ loco::NodeShape infer_broadcast_to(const luci::CircleBroadcastTo *node)
return loco::NodeShape{shape_by_input};
}


loco::NodeShape infer_depth_to_space(const luci::CircleDepthToSpace *node)
{
auto input_shape = luci::shape_get(node->input()).as<loco::TensorShape>();
Expand Down Expand Up @@ -475,7 +474,6 @@ loco::NodeShape infer_depth_to_space(const luci::CircleDepthToSpace *node)
return loco::NodeShape{output_shape};
}


loco::NodeShape infer_expand_dims(const luci::CircleExpandDims *node)
{
const loco::DataType S32 = loco::DataType::S32;
Expand Down Expand Up @@ -1907,7 +1905,6 @@ class ShapeInferenceAlgorithm final : public luci::CircleNodeVisitor<loco::NodeS
return infer_depth_to_space(node);
}


loco::NodeShape visit(const luci::CircleDequantize *node) final
{
const auto input_shape = luci::shape_get(node->input()).as<loco::TensorShape>();
Expand Down
9 changes: 4 additions & 5 deletions compiler/luci/service/src/HelperConv2Ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/


#include "Check.h"
#include "CircleShapeInferenceHelper.h"

Expand All @@ -24,8 +23,7 @@ namespace luci
namespace sinf
{

template <class Conv2DType>
loco::TensorShape conv2d_output_shape(const Conv2DType *node)
template <class Conv2DType> loco::TensorShape conv2d_output_shape(const Conv2DType *node)
{
auto ifm_shape = circle_shape(loco::must_cast<const luci::CircleNode *>(node->input()));
auto ker_shape = circle_shape(loco::must_cast<const luci::CircleNode *>(node->filter()));
Expand Down Expand Up @@ -62,7 +60,8 @@ loco::TensorShape conv2d_output_shape(const Conv2DType *node)
if (node->padding() == luci::Padding::VALID)
{
LUCI_ASSERT(input_height + stride_height > effective_ker_height, "Invalid shape");
output_shape.dim(1).set((input_height + stride_height - effective_ker_height) / stride_height);
output_shape.dim(1).set((input_height + stride_height - effective_ker_height) /
stride_height);
}
else if (node->padding() == luci::Padding::SAME)
{
Expand Down Expand Up @@ -102,4 +101,4 @@ loco::TensorShape conv2d_output_shape(const Conv2DType *node)

} // namespace sinf

} // namespace luci
} // namespace luci
2 changes: 1 addition & 1 deletion compiler/luci/service/src/Nodes/CircleConv2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace sinf
loco::TensorShape Algorithm::visit(const luci::CircleConv2D *node)
{
LOGGER(l);

auto ifm = loco::must_cast<luci::CircleNode *>(node->input());
auto ifm_shape = circle_shape(ifm); // in NHWC
auto ker = loco::must_cast<luci::CircleNode *>(node->filter());
Expand Down
6 changes: 2 additions & 4 deletions compiler/luci/service/src/Nodes/CircleConv2D.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ TEST(CloneNodeTest, clone_Conv2D_padding_NEG)
ASSERT_EQ(nullptr, cloned);
}


TEST(ShapeRuleTest, Conv2D_sinf_dynamic)
{
luci::CircleInput ifm;
Expand All @@ -85,8 +84,7 @@ TEST(ShapeRuleTest, Conv2D_sinf_dynamic)
loco::TensorShape shape;
luci::sinf::Rule shape_inf_rule;
shape_inf_rule.infer(&node_conv2d, shape);



ASSERT_EQ(false, shape.dim(0).known());
ASSERT_EQ(false, shape.dim(1).known());
ASSERT_EQ(true, shape.dim(2).known());
Expand Down Expand Up @@ -115,4 +113,4 @@ TEST(ShapeRuleTest, Conv2D_sinf_without_input_NEG)
loco::TensorShape shape;
luci::sinf::Rule shape_inf_rule;
ASSERT_ANY_THROW(shape_inf_rule.infer(&node_conv2d, shape));
}
}
3 changes: 1 addition & 2 deletions compiler/luci/service/src/Nodes/CircleDepthwiseConv2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ loco::TensorShape Algorithm::visit(const luci::CircleDepthwiseConv2D *node)
auto ker = loco::must_cast<luci::CircleNode *>(node->filter());
auto ker_shape = circle_shape(ker); // in 1 H W CM


assert(ifm_shape.rank() == 4);
assert(ker_shape.rank() == 4);
assert(ker_shape.dim(0).value() == 1);
Expand All @@ -64,7 +63,7 @@ loco::TensorShape Algorithm::visit(const luci::CircleDepthwiseConv2D *node)
// Height and width have already been determined by conv2d_output_shape
ofm_shape.dim(0) = ifm_shape.dim(0);
ofm_shape.dim(3) = ker_shape.dim(3);

return ofm_shape;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ TEST(CloneNodeTest, clone_DepthwiseConv2D_padding_NEG)
ASSERT_EQ(nullptr, cloned);
}


TEST(ShapeRuleTest, DepthwiseConv2D_sinf_dynamic)
{
luci::CircleInput ifm;
Expand All @@ -85,8 +84,7 @@ TEST(ShapeRuleTest, DepthwiseConv2D_sinf_dynamic)
loco::TensorShape shape;
luci::sinf::Rule shape_inf_rule;
shape_inf_rule.infer(&node_dwconv2d, shape);



ASSERT_EQ(false, shape.dim(0).known());
ASSERT_EQ(true, shape.dim(1).known());
ASSERT_EQ(true, shape.dim(2).known());
Expand Down Expand Up @@ -118,4 +116,4 @@ TEST(ShapeRuleTest, DwConv2D_ifm_not_ready_NEG)
loco::TensorShape shape;
luci::sinf::Rule shape_inf_rule;
ASSERT_FALSE(shape_inf_rule.infer(&node_dwconv2d, shape));
}
}

0 comments on commit 4a2ec33

Please sign in to comment.