Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleFL
提交
ff390a95
P
PaddleFL
项目概览
PaddlePaddle
/
PaddleFL
通知
35
Star
5
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
6
列表
看板
标记
里程碑
合并请求
4
Wiki
3
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleFL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
6
Issue
6
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
3
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ff390a95
编写于
8月 27, 2020
作者:
Y
yangqingyou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
limit r by rshift
上级
ba29f12b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
3 addition
and
7 deletion
+3
-7
core/privc3/fixedpoint_tensor_imp.h
core/privc3/fixedpoint_tensor_imp.h
+1
-5
core/privc3/fixedpoint_tensor_test.cc
core/privc3/fixedpoint_tensor_test.cc
+2
-2
未找到文件。
core/privc3/fixedpoint_tensor_imp.h
浏览文件 @
ff390a95
...
@@ -247,11 +247,7 @@ void FixedPointTensor<T, N>::truncate(const FixedPointTensor<T, N>* op,
...
@@ -247,11 +247,7 @@ void FixedPointTensor<T, N>::truncate(const FixedPointTensor<T, N>* op,
}
}
// r'
// r'
aby3_ctx
()
->
template
gen_random_private
(
*
temp
[
0
]);
aby3_ctx
()
->
template
gen_random_private
(
*
temp
[
0
]);
std
::
for_each
(
temp
[
0
]
->
data
(),
temp
[
0
]
->
data
()
+
temp
[
0
]
->
numel
(),
temp
[
0
]
->
rshift
(
1
,
temp
[
0
].
get
());
[]
(
T
&
a
)
{
a
=
(
T
)
(
a
*
std
::
pow
(
2
,
sizeof
(
T
)
*
8
-
2
)
/
std
::
numeric_limits
<
T
>::
max
());
});
//r'_0, r'_1
//r'_0, r'_1
aby3_ctx
()
->
template
gen_random_private
(
*
temp
[
1
]);
aby3_ctx
()
->
template
gen_random_private
(
*
temp
[
1
]);
...
...
core/privc3/fixedpoint_tensor_test.cc
浏览文件 @
ff390a95
...
@@ -3438,7 +3438,7 @@ TEST_F(FixedTensorTest, inv_sqrt_test) {
...
@@ -3438,7 +3438,7 @@ TEST_F(FixedTensorTest, inv_sqrt_test) {
}
}
#ifdef USE_ABY3_TRUNC1 //use aby3 trunc1
#ifdef USE_ABY3_TRUNC1 //use aby3 trunc1
TEST_F
(
FixedTensorTest
,
truncate1_msb_
failed
)
{
TEST_F
(
FixedTensorTest
,
truncate1_msb_
incorrect
)
{
std
::
vector
<
size_t
>
shape
=
{
1
};
std
::
vector
<
size_t
>
shape
=
{
1
};
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sl
[
3
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
)
};
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sl
[
3
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
)
};
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sout
[
6
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
),
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sout
[
6
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
),
...
@@ -3498,7 +3498,7 @@ TEST_F(FixedTensorTest, truncate1_msb_failed) {
...
@@ -3498,7 +3498,7 @@ TEST_F(FixedTensorTest, truncate1_msb_failed) {
}
}
#else
#else
TEST_F
(
FixedTensorTest
,
truncate3_msb_
not_failed
)
{
TEST_F
(
FixedTensorTest
,
truncate3_msb_
correct
)
{
std
::
vector
<
size_t
>
shape
=
{
1
};
std
::
vector
<
size_t
>
shape
=
{
1
};
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sl
[
3
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
)
};
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sl
[
3
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
)
};
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sout
[
6
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
),
std
::
shared_ptr
<
TensorAdapter
<
int64_t
>>
sout
[
6
]
=
{
gen
(
shape
),
gen
(
shape
),
gen
(
shape
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录