Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
c41fbd96
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c41fbd96
编写于
7月 16, 2020
作者:
Z
Zirui Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix minor comments
follow up
上级
74bbfa3c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
9 deletion
+8
-9
mindspore/ccsrc/minddata/dataset/kernels/compose_op.cc
mindspore/ccsrc/minddata/dataset/kernels/compose_op.cc
+1
-2
mindspore/ccsrc/minddata/dataset/kernels/image/random_select_subpolicy_op.cc
...ddata/dataset/kernels/image/random_select_subpolicy_op.cc
+1
-1
mindspore/ccsrc/minddata/dataset/kernels/random_apply_op.cc
mindspore/ccsrc/minddata/dataset/kernels/random_apply_op.cc
+1
-1
mindspore/ccsrc/minddata/dataset/kernels/random_choice_op.cc
mindspore/ccsrc/minddata/dataset/kernels/random_choice_op.cc
+1
-1
mindspore/ccsrc/minddata/dataset/text/kernels/lookup_op.cc
mindspore/ccsrc/minddata/dataset/text/kernels/lookup_op.cc
+4
-4
未找到文件。
mindspore/ccsrc/minddata/dataset/kernels/compose_op.cc
浏览文件 @
c41fbd96
/**
* Copyright 20
19
Huawei Technologies Co., Ltd
* Copyright 20
20
Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -18,7 +18,6 @@
#include <vector>
#include "minddata/dataset/core/tensor.h"
#include "minddata/dataset/kernels/py_func_op.h"
#include "minddata/dataset/kernels/tensor_op.h"
#include "minddata/dataset/util/status.h"
...
...
mindspore/ccsrc/minddata/dataset/kernels/image/random_select_subpolicy_op.cc
浏览文件 @
c41fbd96
/**
* Copyright 20
19
Huawei Technologies Co., Ltd
* Copyright 20
20
Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
mindspore/ccsrc/minddata/dataset/kernels/random_apply_op.cc
浏览文件 @
c41fbd96
/**
* Copyright 20
19
Huawei Technologies Co., Ltd
* Copyright 20
20
Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
mindspore/ccsrc/minddata/dataset/kernels/random_choice_op.cc
浏览文件 @
c41fbd96
/**
* Copyright 20
19
Huawei Technologies Co., Ltd
* Copyright 20
20
Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
mindspore/ccsrc/minddata/dataset/text/kernels/lookup_op.cc
浏览文件 @
c41fbd96
...
...
@@ -26,7 +26,7 @@ LookupOp::LookupOp(std::shared_ptr<Vocab> vocab, WordIdType default_id)
Status
LookupOp
::
Compute
(
const
std
::
shared_ptr
<
Tensor
>
&
input
,
std
::
shared_ptr
<
Tensor
>
*
output
)
{
IO_CHECK
(
input
,
output
);
RETURN_UNEXPECTED_IF_NULL
(
vocab_
);
CHECK_FAIL_RETURN_UNEXPECTED
(
input
->
type
()
==
DataType
::
DE_STRING
,
"None
String Tensor
."
);
CHECK_FAIL_RETURN_UNEXPECTED
(
input
->
type
()
==
DataType
::
DE_STRING
,
"None
string tensor received
."
);
std
::
vector
<
WordIdType
>
word_ids
;
word_ids
.
reserve
(
input
->
Size
());
for
(
auto
itr
=
input
->
begin
<
std
::
string_view
>
();
itr
!=
input
->
end
<
std
::
string_view
>
();
itr
++
)
{
...
...
@@ -34,7 +34,7 @@ Status LookupOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<T
word_ids
.
emplace_back
(
word_id
==
Vocab
::
kNoTokenExists
?
default_id_
:
word_id
);
CHECK_FAIL_RETURN_UNEXPECTED
(
word_ids
.
back
()
!=
Vocab
::
kNoTokenExists
,
"Lookup Error: token
"
+
std
::
string
(
*
itr
)
+
"
doesn't exist in vocab and no unknown token is specified."
);
"Lookup Error: token
: "
+
std
::
string
(
*
itr
)
+
"
doesn't exist in vocab and no unknown token is specified."
);
}
RETURN_IF_NOT_OK
(
Tensor
::
CreateTensor
(
output
,
TensorImpl
::
kFlexible
,
input
->
shape
(),
type_
,
...
...
@@ -42,8 +42,8 @@ Status LookupOp::Compute(const std::shared_ptr<Tensor> &input, std::shared_ptr<T
return
Status
::
OK
();
}
Status
LookupOp
::
OutputType
(
const
std
::
vector
<
DataType
>
&
inputs
,
std
::
vector
<
DataType
>
&
outputs
)
{
CHECK_FAIL_RETURN_UNEXPECTED
(
inputs
.
size
()
==
NumInput
()
&&
outputs
.
size
()
==
NumOutput
(),
"size doesn't match"
);
CHECK_FAIL_RETURN_UNEXPECTED
(
inputs
[
0
]
==
DataType
::
DE_STRING
,
"None String tensor type"
);
CHECK_FAIL_RETURN_UNEXPECTED
(
inputs
.
size
()
==
NumInput
()
&&
outputs
.
size
()
==
NumOutput
(),
"size doesn't match
.
"
);
CHECK_FAIL_RETURN_UNEXPECTED
(
inputs
[
0
]
==
DataType
::
DE_STRING
,
"None String tensor type
.
"
);
outputs
[
0
]
=
type_
;
return
Status
::
OK
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录