Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
c6b413af
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看板
提交
c6b413af
编写于
7月 17, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
7月 17, 2020
浏览文件
操作
浏览文件
下载
差异文件
!3138 Fix some minor comment issues on lookup and other tensorOps
Merge pull request !3138 from ZiruiWu/random_tensor_ops
上级
c07a8d20
c41fbd96
变更
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
浏览文件 @
c6b413af
/**
* 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
浏览文件 @
c6b413af
/**
* 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
浏览文件 @
c6b413af
/**
* 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
浏览文件 @
c6b413af
/**
* 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
浏览文件 @
c6b413af
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录