throwstd::runtime_error("pytensor: ndarray has incorrect number of dimensions");
}
std::copy(PyArray_DIMS(this->python_array()), PyArray_DIMS(this->python_array()) + N, m_shape.begin());
std::transform(PyArray_STRIDES(this->python_array()), PyArray_STRIDES(this->python_array()) + N, m_strides.begin(),
[](auto v) { return v / sizeof(T); });
adapt_strides(m_shape, m_strides, m_backstrides);
if (L != layout_type::dynamic && !do_strides_match(m_shape, m_strides, L, 1))
{
throwstd::runtime_error("pytensor: passing container with wrong strides for static layout. If you are trying to pass a view, set the pytensor layout template parameter to `layout_type::dynamic`, or `layout_type::column_major` for col major.");