Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
4d43bd6c
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4d43bd6c
编写于
8月 28, 2020
作者:
W
wangshuide2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Store data with default datatype in TensorContainer and remove limitation of datatype.
上级
1fd40dc0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
2 addition
and
18 deletion
+2
-18
mindinsight/datavisual/common/exceptions.py
mindinsight/datavisual/common/exceptions.py
+0
-9
mindinsight/datavisual/data_transform/tensor_container.py
mindinsight/datavisual/data_transform/tensor_container.py
+2
-8
mindinsight/utils/constant.py
mindinsight/utils/constant.py
+0
-1
未找到文件。
mindinsight/datavisual/common/exceptions.py
浏览文件 @
4d43bd6c
...
@@ -188,15 +188,6 @@ class ResponseDataExceedMaxValueError(MindInsightException):
...
@@ -188,15 +188,6 @@ class ResponseDataExceedMaxValueError(MindInsightException):
http_code
=
400
)
http_code
=
400
)
class
DataTypeError
(
MindInsightException
):
"""Data_type does not support."""
def
__init__
(
self
,
error_detail
):
error_msg
=
f
'Data type does not support. Detail:
{
error_detail
}
'
super
(
DataTypeError
,
self
).
__init__
(
DataVisualErrors
.
DATA_TYPE_NOT_SUPPORT
,
error_msg
,
http_code
=
400
)
class
TrainJobDetailNotInCacheError
(
MindInsightException
):
class
TrainJobDetailNotInCacheError
(
MindInsightException
):
"""Detail info of given train job is not in cache."""
"""Detail info of given train job is not in cache."""
def
__init__
(
self
,
error_detail
=
"no detail provided."
):
def
__init__
(
self
,
error_detail
=
"no detail provided."
):
...
...
mindinsight/datavisual/data_transform/tensor_container.py
浏览文件 @
4d43bd6c
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
"""Tensor data container."""
"""Tensor data container."""
import
numpy
as
np
import
numpy
as
np
from
mindinsight.datavisual.common.exceptions
import
DataTypeError
from
mindinsight.datavisual.common.log
import
logger
from
mindinsight.datavisual.common.log
import
logger
from
mindinsight.datavisual.data_transform.histogram
import
Histogram
,
Bucket
from
mindinsight.datavisual.data_transform.histogram
import
Histogram
,
Bucket
from
mindinsight.datavisual.proto_files
import
mindinsight_anf_ir_pb2
as
anf_ir_pb2
from
mindinsight.datavisual.proto_files
import
mindinsight_anf_ir_pb2
as
anf_ir_pb2
...
@@ -253,19 +252,14 @@ class TensorContainer:
...
@@ -253,19 +252,14 @@ class TensorContainer:
Get ndarray of tensor.
Get ndarray of tensor.
Args:
Args:
tensor (
float16|float32|float64
): tensor data.
tensor (
mindinsight_anf_ir.proto.DataType
): tensor data.
Returns:
Returns:
numpy.ndarray, ndarray of tensor.
numpy.ndarray, ndarray of tensor.
Raises:
DataTypeError, If data type of tensor is not among float16 or float32 or float64.
"""
"""
data_type_str
=
anf_ir_pb2
.
DataType
.
Name
(
self
.
data_type
)
data_type_str
=
anf_ir_pb2
.
DataType
.
Name
(
self
.
data_type
)
if
data_type_str
==
'DT_FLOAT16'
:
if
data_type_str
==
'DT_FLOAT16'
:
return
np
.
array
(
tuple
(
tensor
),
dtype
=
np
.
float16
).
reshape
(
self
.
dims
)
return
np
.
array
(
tuple
(
tensor
),
dtype
=
np
.
float16
).
reshape
(
self
.
dims
)
if
data_type_str
==
'DT_FLOAT32'
:
if
data_type_str
==
'DT_FLOAT32'
:
return
np
.
array
(
tuple
(
tensor
),
dtype
=
np
.
float32
).
reshape
(
self
.
dims
)
return
np
.
array
(
tuple
(
tensor
),
dtype
=
np
.
float32
).
reshape
(
self
.
dims
)
if
data_type_str
==
'DT_FLOAT64'
:
return
np
.
array
(
tuple
(
tensor
)).
reshape
(
self
.
dims
)
return
np
.
array
(
tuple
(
tensor
),
dtype
=
np
.
float64
).
reshape
(
self
.
dims
)
raise
DataTypeError
(
"Data type: {}."
.
format
(
data_type_str
))
mindinsight/utils/constant.py
浏览文件 @
4d43bd6c
...
@@ -77,7 +77,6 @@ class DataVisualErrors(Enum):
...
@@ -77,7 +77,6 @@ class DataVisualErrors(Enum):
TENSOR_NOT_EXIST
=
18
TENSOR_NOT_EXIST
=
18
MAX_RESPONSE_DATA_EXCEEDED_ERROR
=
19
MAX_RESPONSE_DATA_EXCEEDED_ERROR
=
19
STEP_TENSOR_DATA_NOT_IN_CACHE
=
20
STEP_TENSOR_DATA_NOT_IN_CACHE
=
20
DATA_TYPE_NOT_SUPPORT
=
21
class
ScriptConverterErrors
(
Enum
):
class
ScriptConverterErrors
(
Enum
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录