Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wux_labs
Tensorflow
提交
18960c44
T
Tensorflow
项目概览
wux_labs
/
Tensorflow
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tensorflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
18960c44
编写于
9月 01, 2022
作者:
M
Mihai Maruseac
提交者:
GitHub
9月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #57596 from tensorflow/fix-r2.9
Fix conflict resolution error
上级
5a9ae6b9
850d5c0f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
18 addition
and
7 deletion
+18
-7
tensorflow/python/kernel_tests/quantization_ops/quantization_ops_test.py
...on/kernel_tests/quantization_ops/quantization_ops_test.py
+18
-7
未找到文件。
tensorflow/python/kernel_tests/quantization_ops/quantization_ops_test.py
浏览文件 @
18960c44
...
...
@@ -428,6 +428,14 @@ class QuantizeAndDequantizeV3OpTest(test_util.TensorFlowTestCase):
input
=
inputs
,
input_min
=
[],
input_max
=
4.0
,
out_type
=
dtypes
.
quint8
))
input_value
=
constant_op
.
constant
([
-
0.8
,
-
0.5
,
0
,
0.3
,
0.8
,
-
2.0
],
shape
=
(
6
,),
dtype
=
dtypes
.
float32
),
input_min
=
constant_op
.
constant
(
-
127
,
shape
=
(),
dtype
=
dtypes
.
float32
)
input_max
=
constant_op
.
constant
(
127
,
shape
=
(),
dtype
=
dtypes
.
float32
)
# Tensor with invalid shape and invalid number of elements.
num_bits
=
constant_op
.
constant
([],
shape
=
(
0
,),
dtype
=
dtypes
.
int32
)
# Test that running the op raises error. It raises different errors
# depending on whether the shape inference is run first or the op's
# Compute() is run first.
...
...
@@ -454,13 +462,16 @@ class QuantizeDownAndShrinkRangeOpTest(test_util.TensorFlowTestCase):
@
test_util
.
run_in_graph_and_eager_modes
def
test_invalid_inputs
(
self
):
input_value
=
constant_op
.
constant
([
-
0.8
,
-
0.5
,
0
,
0.3
,
0.8
,
-
2.0
],
shape
=
(
6
,),
dtype
=
dtypes
.
float32
),
input_min
=
constant_op
.
constant
(
-
127
,
shape
=
(),
dtype
=
dtypes
.
float32
)
input_max
=
constant_op
.
constant
(
127
,
shape
=
(),
dtype
=
dtypes
.
float32
)
# Tensor with invalid shape and invalid number of elements.
num_bits
=
constant_op
.
constant
([],
shape
=
(
0
,),
dtype
=
dtypes
.
int32
)
inputs
=
constant_op
.
constant
(
np
.
int32
(
0
),
shape
=
[
3
,
3
,
3
,
3
],
dtype
=
dtypes
.
qint32
)
with
self
.
assertRaisesRegex
((
ValueError
,
errors
.
InvalidArgumentError
),
"must be rank 0"
):
self
.
evaluate
(
math_ops
.
quantize_down_and_shrink_range
(
input
=
inputs
,
input_min
=
[],
input_max
=
4.0
,
out_type
=
dtypes
.
quint8
))
if
__name__
==
"__main__"
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录