-
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
Feature/py executor test #4922
Feature/py executor test #4922
Conversation
and Rename `Sync` to `Flush`
Since lots of types can be cast to bool
…oung/Paddle into dev_impl_conv2d_layer
1. It is no need to make global scope thread-safe, since it will be invoked in Python main thread. 2. Do not free the global scope when C++ exit. Let the OS free memories, otherwise, we need to handle the destroy dependencies. See https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
… dev_impl_conv2d_layer
… dev_impl_conv2d_layer
* Use VLOG to logging some information is helpful when we debug Paddle
b_np = numpy.random.random((784, 100)).astype('float32') | ||
tensor_b = core.LoDTensor() | ||
tensor_b.set(b_np, place) | ||
# del input_tensor |
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.
what is this comment for?
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.
Typo
@@ -256,7 +256,8 @@ def __init__(self, | |||
self.desc.set_block_attr(attr_name, attrs[attr_name].desc) | |||
|
|||
self.desc.check_attrs() | |||
self.desc.infer_shape(self.block.desc) | |||
if type not in {'feed', 'fetch'}: | |||
self.desc.infer_shape(self.block.desc) |
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 can't we infer shape a feed/fetch?
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.
InferVarType is also needed.
self.desc.infer_var_type(self.block.desc)
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.
here infer_shape
is a compile-time method. Feed/Fetch op is a run-time operator, do not need to infer shape.
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.
InferVarType is also needed.
Add in following PRs
'b': tensor_b}, | ||
fetch_list=[out])) | ||
out = numpy.array(outs[0]) | ||
self.assertEqual((100, 100), out.shape) |
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 to check the result
self.assertTrue(numpy.allclose(out, numpy.dot(a_np, b_np)))
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.
Done.
@@ -256,7 +256,8 @@ def __init__(self, | |||
self.desc.set_block_attr(attr_name, attrs[attr_name].desc) | |||
|
|||
self.desc.check_attrs() | |||
self.desc.infer_shape(self.block.desc) | |||
if type not in {'feed', 'fetch'}: | |||
self.desc.infer_shape(self.block.desc) |
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.
InferVarType is also needed.
self.desc.infer_var_type(self.block.desc)
paddle/operators/fetch_op.cc
Outdated
AddInput("X", "The input of fetch op"); | ||
AddOutput("Out", "The output of fetch op"); | ||
AddComment("fetch op, it should not be configured by users directly"); | ||
AddAttr<int>("col", "column of feed"); |
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.
column of feed --> column of fetch
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.
Done.
feed_var_name='feed', | ||
fetch_var_name='fetch'): | ||
if not isinstance(program, Program): | ||
raise TypeError() |
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.
Error message?
Fix #4902