I want to use mkldnn in Libtorch.1.9 with intel cpu.Like this:
// 创建 Strided 布局的张量
torch::Tensor strided_tensor = torch::randn({ 2, 3 });
// 打印当前张量的布局
std::cout << "Original Layout: " << strided_tensor.layout() << std::endl;
// 使用 to 方法将 Strided 布局的张量转换为 MKL-DNN 布局
torch::Tensor mkldnn_tensor = strided_tensor.to(torch::TensorOptions().layout(torch::kMkldnn));
// 打印修改后的布局
std::cout << "Modified Layout: " << mkldnn_tensor.layout() << std::endl;
But is wrong . What should I do?
to(options) doesn't support converting to a different layout, but got self.layout being Strided and options.layout set as Mkldnn