Skip to content

Commit

Permalink
refactor: Update eigen_shape() function to handle vectors in broadcas…
Browse files Browse the repository at this point in the history
…t.hpp
  • Loading branch information
fbriol committed Jul 3, 2024
1 parent a716ce7 commit 278bf72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/fes/detail/broadcast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <stdexcept>
#include <string>

#include "fes/eigen.hpp"

namespace fes {
namespace detail {

Expand All @@ -18,7 +20,11 @@ namespace detail {
template <typename Array>
auto eigen_shape(const Array& array) -> std::string {
std::stringstream ss;
ss << "(" << array.rows() << ", " << array.cols() << ")";
if (is_vector<Array>()) {
ss << "(" << array.size() << ")";
} else {
ss << "(" << array.rows() << ", " << array.cols() << ")";
}
return ss.str();
}

Expand Down

0 comments on commit 278bf72

Please sign in to comment.