Skip to content

Commit

Permalink
Apply code-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnycase authored and github-actions[bot] committed Sep 12, 2024
1 parent 6ab08a1 commit 90632e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
12 changes: 5 additions & 7 deletions src/Native/include/nncase/ntt/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ struct fixed_shape : detail::fixed_dims_base<Dims...> {
using type = fixed_shape<I, Dims...>;
};

template <size_t I> struct append {
using type = fixed_shape<Dims..., I>;
};
template <size_t I> struct append { using type = fixed_shape<Dims..., I>; };

static constexpr size_t length() noexcept { return (Dims * ... * 1); }
};
Expand Down Expand Up @@ -272,10 +270,10 @@ constexpr size_t contiguous_dims(const Shape &shape, const Strides &strides) {
}

template <class Shape, class Strides>
inline constexpr size_t max_size_v =
(is_fixed_dims_v<Shape> && is_fixed_dims_v<Strides>)
? linear_size(Shape{}, Strides{})
: std::dynamic_extent;
inline constexpr size_t max_size_v = (is_fixed_dims_v<Shape> &&
is_fixed_dims_v<Strides>)
? linear_size(Shape{}, Strides{})
: std::dynamic_extent;

template <class Index, class Shape>
constexpr bool in_bound(const Index &index, const Shape &shape) {
Expand Down
11 changes: 5 additions & 6 deletions src/Native/include/nncase/ntt/tensor_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ struct tensor_unary_impl<Op, TTensor> {
};

template <template <class T> class Op, IsTensor TTensor>
requires(TTensor::rank() == 2)
struct tensor_unary_impl<Op, TTensor> {
requires(TTensor::rank() == 2) struct tensor_unary_impl<Op, TTensor> {
using sub_vector_type =
fixed_tensor_alike_t<TTensor, TTensor::shape().at(1)>;

Expand Down Expand Up @@ -94,8 +93,8 @@ struct tensor_binary_impl<Op, TTensor, T2> {
};

template <template <class T1, class T2> class Op, IsTensor T1, IsTensor T2>
requires(T1::rank() == 2 && T2::rank() == 2)
struct tensor_binary_impl<Op, T1, T2> {
requires(T1::rank() == 2 &&
T2::rank() == 2) struct tensor_binary_impl<Op, T1, T2> {
using sub_vector_type = fixed_tensor_alike_t<T1, T1::shape().at(1)>;

constexpr T1 operator()(const T1 &v1, const T2 &v2) const noexcept {
Expand Down Expand Up @@ -178,8 +177,8 @@ template <IsTensor TTensor> struct inner_product<TTensor, TTensor> {

constexpr auto operator()(const TTensor &v1,
const TTensor &v2) const noexcept {
using result_type = decltype(op_(std::declval<element_type>(),
std::declval<element_type>()));
using result_type = decltype(
op_(std::declval<element_type>(), std::declval<element_type>()));
result_type value{};
apply(v1.shape(),
[&](auto index) { value += op_(v1(index), v2(index)); });
Expand Down

0 comments on commit 90632e1

Please sign in to comment.