Function mindspore::dataset::Transpose

Function Documentation

bool mindspore::dataset::Transpose(const LiteMat &src, LiteMat &dst)

Matrix transpose.

Parameters
  • src[in] Input matrix.

  • dst[in] Output matrix.

Returns

Return true if transform successfully.

样例
/* Assume p_rgb is a pointer that points to an image with shape (width, height, channel) */
LiteMat lite_mat_src(width, height, channel, (void *)p_rgb, LDataType::UINT8);
LiteMat lite_mat_src2;
ConvertTo(lite_mat_src, lite_mat_src2);
LiteMat lite_mat_dst;

/* Transpose image */
Transpose(lite_mat_src2, lite_mat_dst);
std::cout << lite_mat_dst.width_ << " " << lite_mat_dst.height_ << " " << lite_mat_dst.channel_ << std::endl;