Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尽管源视图和目标视图的形状相同,但分配给视图后的输出使用单个元素进行广播。请让我知道我到底在哪里做错了。
请参考随附的代码和输出图像。
NB输出
问题是形状不一样:尺寸不匹配。bb维度为 3。
bb
因此,要使其正常工作,需要squeeze, 以删除第一个维度,或者像这样使用连接:
squeeze
xt::xarray<float, xt::layout_type::row_major> bb = xt::eval(xt::concatenate(xt::xtuple(b1, b2, b3, b4), 1));