| 99 | } |
| 100 | |
| 101 | mluOpStatus_t MLUOP_WIN_API mluOpSetSeqDataDescriptor( |
| 102 | mluOpSeqDataDescriptor_t seq_data_desc, mluOpSeqDataLayout_t layout, |
| 103 | mluOpDataType_t dtype, int dimNb, const int *dimSize, |
| 104 | int seqLengthArraySize, const int *seqLengthArray, void *paddingFill) { |
| 105 | CHECK_RETURN("[mluOpSetSeqDataDescriptor]", |
| 106 | mluOpSetSeqDataDescriptorBase( |
| 107 | seq_data_desc, layout, dtype, dimNb, (void *)dimSize, |
| 108 | seqLengthArraySize, (void *)seqLengthArray, paddingFill)); |
| 109 | |
| 110 | seq_data_desc->dims.clear(); |
| 111 | for (int i = 0; i < dimNb; ++i) { |
| 112 | PARAM_CHECK_GE("[mluOpSetSeqDataDescriptor]", dimSize[i], 0); |
| 113 | seq_data_desc->dims.push_back(static_cast<int64_t>(dimSize[i])); |
| 114 | } |
| 115 | seq_data_desc->seq_length.clear(); |
| 116 | if (seqLengthArray != nullptr) { |
| 117 | for (int i = 0; i < seqLengthArraySize; ++i) { |
| 118 | PARAM_CHECK_GT("[mluOpSetSeqDataDescriptor]", seqLengthArray[i], 0); |
| 119 | seq_data_desc->seq_length.push_back( |
| 120 | static_cast<int64_t>(seqLengthArray[i])); |
| 121 | } |
| 122 | } |
| 123 | return MLUOP_STATUS_SUCCESS; |
| 124 | } |
| 125 | |
| 126 | mluOpStatus_t MLUOP_WIN_API mluOpSetSeqDataDescriptor_v2( |
| 127 | mluOpSeqDataDescriptor_t seq_data_desc, mluOpSeqDataLayout_t layout, |