@@ -135,4 +135,18 @@ TEST(TensorCondProxyFromConstantF, BasicAssertions) {
135135 auto tensor = vt::arange (24 , vt::Order::F)({0 , 24 , 2 }).reshape (3 , 4 );
136136 tensor[tensor > 12 .0f ] = 1 .0f ;
137137 EXPECT_EQ (vt::asvector (tensor), (std::vector<float >{0 , 2 , 4 , 6 , 8 , 10 , 12 , 1 , 1 , 1 , 1 , 1 }));
138- }
138+ }
139+
140+ TEST (BroadcastSliceAssignmentC, BasicAssertions) {
141+ auto tensor = vt::arange (12 ).reshape (4 , 3 );
142+ tensor (vt::Slice::all (), vt::Slice (0 , 2 , 1 )) = tensor (vt::Slice::all (), vt::Slice (2 , 3 , 1 ));
143+ EXPECT_EQ (vt::asvector (tensor), (std::vector<float >{2 , 2 , 2 , 5 , 5 , 5 , 8 , 8 , 8 , 11 , 11 , 11 }));
144+ EXPECT_EQ (tensor.contiguous (), true );
145+ }
146+
147+ TEST (BroadcastSliceAssignmentF, BasicAssertions) {
148+ auto tensor = vt::arange (12 , vt::Order::F).reshape (4 , 3 );
149+ tensor (vt::Slice::all (), vt::Slice (0 , 2 , 1 )) = tensor (vt::Slice::all (), vt::Slice (2 , 3 , 1 ));
150+ EXPECT_EQ (vt::asvector (tensor), (std::vector<float >{8 , 9 , 10 , 11 , 8 , 9 , 10 , 11 , 8 , 9 , 10 , 11 }));
151+ EXPECT_EQ (tensor.contiguous (), true );
152+ }
0 commit comments