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

Function MLUOP_WIN_API mluOpSetSeqDataDescriptor

core/tensor.cpp:101–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101mluOpStatus_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
126mluOpStatus_t MLUOP_WIN_API mluOpSetSeqDataDescriptor_v2(
127 mluOpSeqDataDescriptor_t seq_data_desc, mluOpSeqDataLayout_t layout,

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected