提交 97c64254 编写于 作者: Y Yu Yang

Add some more interfaces

上级 c32ade74
......@@ -72,4 +72,37 @@ int PDArgsGetIds(PD_Arguments args, uint64_t ID, PD_IVector ids) {
iv->vec = a->args[ID].ids;
return kPD_NO_ERROR;
}
int PDArgsSetIds(PD_Arguments args, uint64_t ID, PD_IVector ids) {
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
int PDArgsSetSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector seqPos) {
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
int PDArgsSetSubSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector subSeqPos) {
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
int PDArgsGetSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector seqPos) {
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
int PDArgsGetSubSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector subSeqPos) {
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
}
......@@ -51,6 +51,19 @@ typedef void* PD_IVector;
PD_API int PDIVecCreateNone(PD_IVector* ivec);
/**
* @brief PDIVectorCreate create a paddle int vector
* @param [out] ivec: output int vector.
* @param [in] array: input array.
* @param [in] size: input array size.
* @param [in] copy: memory copy or just use same memory. True if copy.
* @return PD_Error
*/
PD_API int PDIVectorCreate(PD_IVector* ivec,
int* array,
uint64_t size,
bool copy);
PD_API int PDIVecDestroy(PD_IVector ivec);
PD_API int PDIVectorGet(PD_IVector ivec, int** buffer);
......@@ -99,6 +112,23 @@ PD_API int PDArgsGetValue(PD_Arguments args, uint64_t ID, PD_Matrix mat);
PD_API int PDArgsGetIds(PD_Arguments args, uint64_t ID, PD_IVector ids);
PD_API int PDArgsSetIds(PD_Arguments args, uint64_t ID, PD_IVector ids);
PD_API int PDArgsSetSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector seqPos);
PD_API int PDArgsGetSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector seqPos);
PD_API int PDArgsSetSubSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector subSeqPos);
PD_API int PDArgsGetSubSequenceStartPos(PD_Arguments args,
uint64_t ID,
PD_IVector subSeqPos);
/**
* @brief GradientMachine means a neural network.
*/
......
......@@ -26,6 +26,11 @@ int PDIVecCreateNone(PD_IVector* ivec) {
return kPD_NO_ERROR;
}
int PDIVectorCreate(PD_IVector* ivec, int* array, uint64_t size, bool copy) {
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
int PDIVecDestroy(PD_IVector ivec) {
if (ivec == nullptr) return kPD_NULLPTR;
delete cast<paddle::capi::CIVector>(ivec);
......@@ -41,12 +46,12 @@ int PDIVectorGet(PD_IVector ivec, int** buffer) {
}
int PDIVectorResize(PD_IVector ivec, uint64_t size) {
// TODO(lizhao): Complete this method.
return 0;
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
int PDIVectorGetSize(PD_IVector ivec, uint64_t* size) {
// TODO(lizhao): Complete this method.
return 0;
//! TODO(lizhao): Complete this method.
return kPD_UNDEFINED_ERROR;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册