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

Function MLUOP_WIN_API mluOpGetTensorAndDataFromTensorSet

core/tensor.cpp:959–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957}
958
959mluOpStatus_t MLUOP_WIN_API mluOpGetTensorAndDataFromTensorSet(
960 mluOpTensorSetDescriptor_t tensorSet, const int tensorSetDimNb,
961 const int *tensorIndex, void *data, mluOpTensorDescriptor_t *tensorDesc,
962 void **dataAddrInDevice) {
963 PARAM_CHECK("[mluOpGetTensorAndDataFromTensorSet]", tensorSet != NULL);
964 PARAM_CHECK("[mluOpGetTensorAndDataFromTensorSet]",
965 tensorSet->dim_num == tensorSetDimNb);
966 *tensorDesc = tensorSet->getTensor(tensorIndex);
967 auto offset = tensorSet->getOffset(tensorIndex);
968 *dataAddrInDevice = (void *)((char *)data + offset);
969 return MLUOP_STATUS_SUCCESS;
970}
971
972mluOpStatus_t MLUOP_WIN_API mluOpSetSeqDataDescriptorOnchipDataType(
973 mluOpSeqDataDescriptor_t desc, mluOpDataType_t onchip_dtype) {

Callers

nothing calls this directly

Calls 2

getTensorMethod · 0.80
getOffsetMethod · 0.80

Tested by

no test coverage detected