提交 0874a7e8 编写于 作者: Y Yu Yang

Fix typo in API.h

上级 3b5bed68
...@@ -39,15 +39,18 @@ add_custom_target(paddle_capi_whole ALL ...@@ -39,15 +39,18 @@ add_custom_target(paddle_capi_whole ALL
COMMAND mkdir -p o_files/math && cd o_files/math/ && ar -x $<TARGET_FILE:paddle_math> COMMAND mkdir -p o_files/math && cd o_files/math/ && ar -x $<TARGET_FILE:paddle_math>
COMMAND mkdir -p o_files/cuda && cd o_files/cuda/ && ar -x $<TARGET_FILE:paddle_cuda> COMMAND mkdir -p o_files/cuda && cd o_files/cuda/ && ar -x $<TARGET_FILE:paddle_cuda>
COMMAND mkdir -p o_files/function && cd o_files/function/ && ar -x $<TARGET_FILE:paddle_function> COMMAND mkdir -p o_files/function && cd o_files/function/ && ar -x $<TARGET_FILE:paddle_function>
COMMAND mkdir -p o_files/pserver && cd o_files/pserver/ && ar -x $<TARGET_FILE:paddle_pserver>
COMMAND mkdir -p o_files/gserver && cd o_files/gserver/ && ar -x $<TARGET_FILE:paddle_gserver> COMMAND mkdir -p o_files/gserver && cd o_files/gserver/ && ar -x $<TARGET_FILE:paddle_gserver>
COMMAND mkdir -p o_files/proto && cd o_files/proto/ && ar -x $<TARGET_FILE:paddle_proto> COMMAND mkdir -p o_files/proto && cd o_files/proto/ && ar -x $<TARGET_FILE:paddle_proto>
COMMAND mkdir -p o_files/network && cd o_files/network/ && ar -x
+$<TARGET_FILE:paddle_network>
+ COMMAND mkdir -p o_files/pserver && cd o_files/pserver/ && ar -x
+$<TARGET_FILE:paddle_pserver
COMMAND ar crs ${capi_whole_library} `find ./o_files -name '*.o'` COMMAND ar crs ${capi_whole_library} `find ./o_files -name '*.o'`
COMMAND rm -rf o_files COMMAND rm -rf o_files
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS paddle_capi paddle_utils paddle_parameter paddle_math DEPENDS paddle_capi paddle_utils paddle_parameter paddle_math
paddle_cuda paddle_function paddle_pserver paddle_gserver paddle_cuda paddle_function paddle_gserver
paddle_proto paddle_proto paddle_pserver paddle_network
) )
set_target_properties(paddle_capi_whole set_target_properties(paddle_capi_whole
PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${capi_whole_library}) PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${capi_whole_library})
......
...@@ -67,26 +67,26 @@ int PDArgsGetValue(PD_Arguments args, uint64_t ID, PD_Matrix mat); ...@@ -67,26 +67,26 @@ int PDArgsGetValue(PD_Arguments args, uint64_t ID, PD_Matrix mat);
int PDArgsGetIds(PD_Arguments args, uint64_t ID, PD_IVector ids); int PDArgsGetIds(PD_Arguments args, uint64_t ID, PD_IVector ids);
typedef void* PD_GradiemtMachine; typedef void* PD_GradientMachine;
int PDGradientMachineCreateForPredict(PD_GradiemtMachine* machine, int PDGradientMachineCreateForPredict(PD_GradientMachine* machine,
void* modelConfigProtobuf, void* modelConfigProtobuf,
int size); int size);
int PDGradientMachineLoadParameterFromDisk(PD_GradiemtMachine machine, int PDGradientMachineLoadParameterFromDisk(PD_GradientMachine machine,
const char* path); const char* path);
int PDGradientMachineForward(PD_GradiemtMachine machine, int PDGradientMachineForward(PD_GradientMachine machine,
PD_Arguments inArgs, PD_Arguments inArgs,
PD_Arguments outArgs, PD_Arguments outArgs,
bool isTrain); bool isTrain);
int PDGradientMachineCreateSharedParam(PD_GradiemtMachine origin, int PDGradientMachineCreateSharedParam(PD_GradientMachine origin,
void* modelConfigProtobuf, void* modelConfigProtobuf,
int size, int size,
PD_GradiemtMachine* slave); PD_GradientMachine* slave);
int PDGradientMachineDestroy(PD_GradiemtMachine machine); int PDGradientMachineDestroy(PD_GradientMachine machine);
int PDInit(int argc, char** argv); int PDInit(int argc, char** argv);
......
...@@ -36,7 +36,7 @@ TEST(GradientMachine, testPredict) { ...@@ -36,7 +36,7 @@ TEST(GradientMachine, testPredict) {
paddle::TrainerConfigHelper config("./test_predict_network.py"); paddle::TrainerConfigHelper config("./test_predict_network.py");
std::string buffer; std::string buffer;
ASSERT_TRUE(config.getModelConfig().SerializeToString(&buffer)); ASSERT_TRUE(config.getModelConfig().SerializeToString(&buffer));
PD_GradiemtMachine machine; PD_GradientMachine machine;
ASSERT_EQ(kPD_NO_ERROR, ASSERT_EQ(kPD_NO_ERROR,
PDGradientMachineCreateForPredict( PDGradientMachineCreateForPredict(
...@@ -50,7 +50,7 @@ TEST(GradientMachine, testPredict) { ...@@ -50,7 +50,7 @@ TEST(GradientMachine, testPredict) {
ASSERT_EQ(kPD_NO_ERROR, ASSERT_EQ(kPD_NO_ERROR,
PDGradientMachineLoadParameterFromDisk(machine, "./")); PDGradientMachineLoadParameterFromDisk(machine, "./"));
PD_GradiemtMachine machineSlave; PD_GradientMachine machineSlave;
ASSERT_EQ(kPD_NO_ERROR, ASSERT_EQ(kPD_NO_ERROR,
PDGradientMachineCreateSharedParam( PDGradientMachineCreateSharedParam(
machine, &buffer[0], (int)buffer.size(), &machineSlave)); machine, &buffer[0], (int)buffer.size(), &machineSlave));
......
...@@ -21,6 +21,7 @@ __all__ = [] ...@@ -21,6 +21,7 @@ __all__ = []
if __name__ == '__main__': if __name__ == '__main__':
whole_conf = False whole_conf = False
binary = False binary = False
print sys.argv
if len(sys.argv) == 2: if len(sys.argv) == 2:
conf = parse_config(sys.argv[1], '') conf = parse_config(sys.argv[1], '')
elif len(sys.argv) == 3: elif len(sys.argv) == 3:
...@@ -40,6 +41,6 @@ if __name__ == '__main__': ...@@ -40,6 +41,6 @@ if __name__ == '__main__':
print conf print conf
else: else:
if binary: if binary:
sys.stdout.write(conf.SerializeToString()) sys.stdout.write(conf.model_config.SerializeToString())
else: else:
print conf.model_config print conf.model_config
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册