提交 62d028c8 编写于 作者: J jingqinghe

update

上级 7da61872
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
INCLUDE(ExternalProject)
SET(HIREDIS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
SET(HIREDIS_INCLUDE_DIRS ${HIREDIS_DIR})
SET(HIREDIS_NAME "hiredis" CACHE STRING "" FORCE)
SET(HIREDIS_URL "https://paddlefl.bj.bcebos.com/hiredis.tar.gz" CACHE STRING "" FORCE)
ExternalProject_Add(
extern_hiredis
#URL https://paddlefl.bj.bcebos.com/hiredis.tar.gz
# GIT_REPOSITORY "https://github.com/redis/hiredis"
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/hiredis
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
DOWNLOAD_COMMAND wget --no-check-certificate ${HIREDIS_URL} -c -q -O ${HIREDIS_NAME}.tar.gz
&& tar xf ${HIREDIS_NAME}.tar.gz --strip-components 1
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND make static
INSTALL_COMMAND "")
INCLUDE_DIRECTORIES(${HIREDIS_INCLUDE_DIRS})
message(STATUS "${HIREDIS_INCLUDE_DIRS}")
ADD_LIBRARY(hiredis SHARED IMPORTED GLOBAL)
ADD_DEPENDENCIES(hiredis extern_hiredis)
\ No newline at end of file
...@@ -106,9 +106,9 @@ template <typename DeviceContext, typename T> ...@@ -106,9 +106,9 @@ template <typename DeviceContext, typename T>
class MpcElementwiseAddKernel : public MpcOpKernel<T> { class MpcElementwiseAddKernel : public MpcOpKernel<T> {
public: public:
void ComputeImpl(const framework::ExecutionContext &ctx) const override { void ComputeImpl(const framework::ExecutionContext &ctx) const override {
auto *in_x_t = ctx.Input<framework::LoDTensor>("X"); auto *in_x_t = ctx.Input<LoDTensor>("X");
auto *in_y_t = ctx.Input<framework::LoDTensor>("Y"); auto *in_y_t = ctx.Input<LoDTensor>("Y");
auto *out_t = ctx.Output<framework::LoDTensor>("Out"); auto *out_t = ctx.Output<LoDTensor>("Out");
int axis = ctx.Attr<int>("axis"); int axis = ctx.Attr<int>("axis");
......
...@@ -90,7 +90,7 @@ def make_shares(num_array): ...@@ -90,7 +90,7 @@ def make_shares(num_array):
[c2, d2]]] [c2, d2]]]
""" """
old_size = num_array.size old_size = num_array.size
flat_num_array = num_array.reshape(old_size, ) flat_num_array = num_array.reshape(old_size,)
new_shape = (SHARE_NUM, ) + num_array.shape new_shape = (SHARE_NUM, ) + num_array.shape
result = np.empty((old_size, SHARE_NUM), dtype=np.int64) result = np.empty((old_size, SHARE_NUM), dtype=np.int64)
for idx in six.moves.range(0, old_size): for idx in six.moves.range(0, old_size):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册