Skip to content

Commit

Permalink
minor Eigen fix for debug mode compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed May 3, 2023
1 parent 74235fa commit a965f5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/nanobind/eigen/dense.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ struct type_caster<Eigen::Map<T, Options, StrideType>, enable_if_t<is_eigen_plai

operator Map() {
NDArray &t = caster.value;
return Map(t.data(), t.shape(0), t.shape(1), strides());
return Map(t.data(), t.shape(0), t.ndim() == 1 ? 1 : t.shape(1),
strides());
}
};

Expand Down

0 comments on commit a965f5b

Please sign in to comment.