I want to transpose a Halide::Buffer.Is there a way to do it?
I have tried transpose() in Halide. But it shows error.
Halide::Func B;
Halide::Var x, y, c;
B(x, y, c)= 0.0f;
B(0,0,c)= 1.0f; B(1,0,c)= 0.0f; B(2,0,c)= 0.0f;
B(0,1,c)= 1.0f; B(1,1,c)= 2.0f; B(2,1,c)= 0.0f;
B(0,2,c)= 1.0f; B(1,2,c)= 2.0f; B(2,2,c)= 3.0f;
Halide::Buffer<float> B_mat = B.realize(6, 6, 1);
Halide::Buffer<float> C_mat = B_mat.transposed(0,1);
error: conversion from ‘void’ to non-scalar type ‘Halide::Buffer’ requested Halide::Buffer C_mat = B_mat.transpose(0,1);