-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Eager] Slice #40587
[Eager] Slice #40587
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some commets
const paddle::platform::Place& place, | ||
paddle::framework::AttributeMap* default_attrs, | ||
bool use_default_attr_map, | ||
const std::map<std::string, std::string>& inplace_map) { | ||
VLOG(6) << "Running On Eager TraceOp with use_default_attr_map: " | ||
<< use_default_attr_map; | ||
TraceOp<egr::EagerVariable>(type, ins, outs, std::move(attrs), place, false, | ||
inplace_map, default_attrs, use_default_attr_map); | ||
TraceOpImpl<egr::EagerVariable>(type, ins, outs, attrs, place, false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个我当面给你讲过,TraceOp会修改attr,所以我需要在前向时,传入attr的引用,让TraceOp完成attr->check相关动作,再将新的attr返回给Eager前向,这样,Eager前向把正确的attr保存到反向使用。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
paddle/fluid/pybind/eager_method.cc
Outdated
@@ -211,6 +228,21 @@ static PyObject* tensor_method__is_initialized(TensorObject* self, | |||
EAGER_CATCH_AND_THROW_RETURN_NULL | |||
} | |||
|
|||
static PyObject* tensor_method__dense_tensor_is_initialized(TensorObject* self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(tensor)时,需要看LoDTensor是否初始化。否则我们的打印和老动态图的打印格式无法对齐。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但是 Tensor自己的_initialized已经可以完成这个功能了把
@@ -602,6 +638,216 @@ static PyObject* tensor__getitem_index_not_tensor(TensorObject* self, | |||
EAGER_CATCH_AND_THROW_RETURN_NULL | |||
} | |||
|
|||
static PyObject* tensor_method__setitem_eager_tensor(TensorObject* self, | |||
PyObject* args, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better don't copy code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Describe
Eager 对齐老动态图 Slice