Eigen::Tensor, how to access matrix from Tensor
I have the following Eigen Tensor: Eigen::Tensor<float, 3> m(3,10,10); I want to access the 1st matrix. In numpy I would do it as such m(0,:,:) How would I do this in Eigen You can access parts of a tensor using .slice(...) or .chip(...) . Do this to access the first matrix, equivalent to numpy m(0,:,:) : Eigen::Tensor<double,3> m(3,10,10); //Initialize m.setRandom(); //Set random values Eigen::array<long,3> offset = {0,0,0}; //Starting point Eigen::array<long,3> extent = {1,10,10}; //Finish point std::cout << m.slice(offset, extent).reshape(Eigen::array<long,2>{10,10}) << std::endl; //Reshape