Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
4733fe60
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4733fe60
编写于
4月 14, 2022
作者:
C
Chen Weihang
提交者:
GitHub
4月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove all is initialized using (#41766)
上级
54ccc308
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
10 addition
and
10 deletion
+10
-10
paddle/fluid/distributed/collective/reducer.cc
paddle/fluid/distributed/collective/reducer.cc
+2
-2
paddle/fluid/eager/grad_node_info.cc
paddle/fluid/eager/grad_node_info.cc
+2
-2
paddle/fluid/eager/to_static/run_program_op_node.h
paddle/fluid/eager/to_static/run_program_op_node.h
+1
-1
paddle/fluid/eager/utils.cc
paddle/fluid/eager/utils.cc
+1
-1
paddle/fluid/pybind/eager_method.cc
paddle/fluid/pybind/eager_method.cc
+2
-2
paddle/phi/api/lib/tensor_method.cc
paddle/phi/api/lib/tensor_method.cc
+2
-2
未找到文件。
paddle/fluid/distributed/collective/reducer.cc
浏览文件 @
4733fe60
...
...
@@ -398,7 +398,7 @@ void EagerReducer::InitializeDenseGroups(
"GRAD is SelectedRows"
,
tensor_name
));
PADDLE_ENFORCE_EQ
(
tensor
.
i
s_i
nitialized
(),
true
,
PADDLE_ENFORCE_EQ
(
tensor
.
initialized
(),
true
,
platform
::
errors
::
PreconditionNotMet
(
"Tensor %s is not initialized."
,
tensor_name
));
const
auto
size
=
tensor
.
numel
();
...
...
@@ -710,7 +710,7 @@ void EagerReducer::MarkGroupReady(size_t group_index) {
bool
EagerReducer
::
HasGrad
(
size_t
var_index
)
{
auto
grad
=
egr
::
EagerUtils
::
mutable_grad
(
tensors_
[
var_index
]);
if
(
grad
&&
grad
->
i
s_i
nitialized
())
{
if
(
grad
&&
grad
->
initialized
())
{
return
true
;
}
else
{
return
false
;
...
...
paddle/fluid/eager/grad_node_info.cc
浏览文件 @
4733fe60
...
...
@@ -125,7 +125,7 @@ void GradNodeBase::SetGradInMeta(const paddle::experimental::Tensor& fwd_out,
auto
&
meta
=
metas
[
0
];
meta
.
SetStopGradient
(
fwd_out_meta
->
StopGradient
());
if
(
!
fwd_out
.
i
s_i
nitialized
())
{
if
(
!
fwd_out
.
initialized
())
{
VLOG
(
6
)
<<
"Skip Configuring GradSlotMeta for uninitialized GradInput Tensor"
;
return
;
...
...
@@ -192,7 +192,7 @@ void GradNodeBase::SetGradInMeta(
meta
.
SetStopGradient
(
fwd_out_meta
->
StopGradient
());
}
if
(
!
fwd_out_tensor
.
i
s_i
nitialized
())
{
if
(
!
fwd_out_tensor
.
initialized
())
{
VLOG
(
6
)
<<
"Skip Configuring GradSlotMeta for uninitialized GradInput Tensor"
;
return
;
...
...
paddle/fluid/eager/to_static/run_program_op_node.h
浏览文件 @
4733fe60
...
...
@@ -114,7 +114,7 @@ static void ShareTensorsIntoScope(const std::vector<Tensor> &tensors,
paddle
::
framework
::
Scope
*
scope
)
{
for
(
size_t
i
=
0
;
i
<
tensors
.
size
();
++
i
)
{
auto
name
=
tensors
[
i
].
name
();
if
(
name
==
"Fake_var"
||
!
tensors
[
i
].
i
s_i
nitialized
())
{
if
(
name
==
"Fake_var"
||
!
tensors
[
i
].
initialized
())
{
continue
;
}
auto
*
var
=
scope
->
Var
(
name
);
...
...
paddle/fluid/eager/utils.cc
浏览文件 @
4733fe60
...
...
@@ -446,7 +446,7 @@ void EagerUtils::FillZeroForEmptyGradInputs(
for
(
size_t
i
=
0
;
i
<
in_grads
->
size
();
i
++
)
{
for
(
size_t
j
=
0
;
j
<
(
*
in_grads
)[
i
].
size
();
j
++
)
{
paddle
::
experimental
::
Tensor
&
grad
=
(
*
in_grads
)[
i
][
j
];
if
(
!
grad
.
i
s_i
nitialized
())
{
if
(
!
grad
.
initialized
())
{
const
GradSlotMeta
&
grad_in_meta
=
grad_in_metas
[
i
][
j
];
PADDLE_ENFORCE
(
grad_in_meta
.
HasTensorMeta
(),
...
...
paddle/fluid/pybind/eager_method.cc
浏览文件 @
4733fe60
...
...
@@ -617,7 +617,7 @@ static PyObject* tensor__getitem_index_not_tensor(TensorObject* self,
// if index is a list, list_select_flag will be true
bool
list_select_flag
=
false
;
PADDLE_ENFORCE_EQ
(
self
->
tensor
.
i
s_i
nitialized
(),
true
,
self
->
tensor
.
initialized
(),
true
,
platform
::
errors
::
InvalidArgument
(
"tensor %s has not been initialized, we can only slice initialized "
"tensor please init it first with numpy or other tensor."
,
...
...
@@ -1146,7 +1146,7 @@ static PyObject* tensor__copy_gradient_from(TensorObject* self, PyObject* args,
PyObject
*
kwargs
)
{
EAGER_TRY
auto
src
=
CastPyArg2Tensor
(
PyTuple_GET_ITEM
(
args
,
0
),
0
);
if
(
self
->
tensor
.
i
s_i
nitialized
())
{
if
(
self
->
tensor
.
initialized
())
{
PADDLE_ENFORCE_EQ
(
self
->
tensor
.
dtype
(),
src
.
dtype
(),
platform
::
errors
::
PreconditionNotMet
(
"Tensor %s has different data type with Tensor %s"
,
...
...
paddle/phi/api/lib/tensor_method.cc
浏览文件 @
4733fe60
...
...
@@ -73,7 +73,7 @@ Tensor::copy_to<phi::dtype::float16>(const Place &target_place) const;
void
Tensor
::
copy_
(
const
Tensor
&
src
,
const
phi
::
Place
&
target_place
,
bool
blocking
)
{
if
(
!
src
.
i
s_i
nitialized
())
{
if
(
!
src
.
initialized
())
{
VLOG
(
8
)
<<
"Src is empty, skip copy"
;
return
;
}
...
...
@@ -81,7 +81,7 @@ void Tensor::copy_(const Tensor &src,
auto
kernel_key_set
=
ParseKernelKeyByInputArgs
(
src
);
KernelType
kernel_type
=
ParseKernelTypeByInputArgs
(
src
);
VLOG
(
3
)
<<
"Deep copy Tensor from "
<<
src
.
name
()
<<
" to "
<<
name
();
if
(
i
s_i
nitialized
())
{
if
(
initialized
())
{
PADDLE_ENFORCE_EQ
(
dtype
(),
src
.
dtype
(),
phi
::
errors
::
PreconditionNotMet
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录