| 865 | } |
| 866 | |
| 867 | mluOpStatus_t MLUOP_WIN_API mluOpCreateTensorSetDescriptor( |
| 868 | mluOpTensorSetDescriptor_t *tensorSet, const int tensorSetDimNb, |
| 869 | const int *tensorSetDimSize) { |
| 870 | mluOpTensorSetStruct *tss = new (std::nothrow) mluOpTensorSetStruct(); |
| 871 | tss->dim_num = tensorSetDimNb; |
| 872 | int set_size = 1; |
| 873 | for (int i = 0; i < tensorSetDimNb; i++) { |
| 874 | set_size *= tensorSetDimSize[i]; |
| 875 | tss->dim_set.push_back(tensorSetDimSize[i]); |
| 876 | int j = i + 1; |
| 877 | int offset_base = 1; |
| 878 | while (j < tensorSetDimNb) { |
| 879 | offset_base *= tensorSetDimSize[j]; |
| 880 | j++; |
| 881 | } |
| 882 | tss->dim_offset_base.push_back(offset_base); |
| 883 | } |
| 884 | for (int i = 0; i < set_size; i++) { |
| 885 | auto ts = std::make_shared<mluOpTensorStruct>(); |
| 886 | tss->tensor_set.push_back(ts); |
| 887 | } |
| 888 | tss->tensor_num = set_size; |
| 889 | tss->dataOffsetInit(set_size); |
| 890 | tss->user_indices.resize(set_size); |
| 891 | *tensorSet = tss; |
| 892 | return MLUOP_STATUS_SUCCESS; |
| 893 | } |
| 894 | |
| 895 | mluOpStatus_t MLUOP_WIN_API mluOpGetTensorSetDescriptor( |
| 896 | mluOpTensorSetDescriptor_t tensorSet, int *tensorSetDimNb, int *dimSize) { |
nothing calls this directly
no test coverage detected