MCPcopy Create free account
hub / github.com/Cambricon/mlu-ops / getTensorDescriptorEx

Method getTensorDescriptorEx

core/tensor.cpp:480–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480mluOpStatus_t mluOpTensorStruct::getTensorDescriptorEx(
481 mluOpTensorLayout_t *layout, mluOpDataType_t *dtype, int *dimNb,
482 int *dimSize, int *dimStride) {
483 PARAM_CHECK("[mluOpGetTensorDescriptorEx]", layout != NULL);
484 PARAM_CHECK("[mluOpGetTensorDescriptorEx]", dtype != NULL);
485 PARAM_CHECK("[mluOpGetTensorDescriptorEx]", dimNb != NULL);
486 PARAM_CHECK("[mluOpGetTensorDescriptorEx]", dimSize != NULL);
487 PARAM_CHECK("[mluOpGetTensorDescriptorEx]", dimStride != NULL);
488
489 *layout = this->layout;
490 *dtype = this->dtype;
491 *dimNb = this->dim;
492 for (int i = 0; i < *dimNb; ++i) {
493 dimSize[i] = static_cast<int>(this->dims[i]);
494 dimStride[i] = static_cast<int>(this->strides[i]);
495 }
496
497 return MLUOP_STATUS_SUCCESS;
498}
499
500mluOpStatus_t mluOpTensorStruct::getTensorDescriptorEx_v2(
501 mluOpTensorLayout_t *layout, mluOpDataType_t *dtype, int *dimNb,

Calls

no outgoing calls

Tested by

no test coverage detected