Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[numpy] Fix test_dynamic_shape.test_dynamic_shape #14538

Merged
merged 2 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/c_api/c_api_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ struct MXAPIThreadLocalEntry {
data->resize(shapes.size());
size_t size = 0;
for (const auto& s : shapes) {
if (s.ndim() > 0);
size += s.ndim();
if (s.ndim() > 0) {
size += s.ndim();
}
}
buffer->resize(size);
int *ptr = buffer->data();
Expand Down
2 changes: 1 addition & 1 deletion src/imperative/imperative_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void NaiveRunGraph(
Imperative::Get()->InvokeOp(ctx, node.source->attrs, ndinputs, ndoutputs,
req, dispatch_mode, state);
for (size_t j = 0; j < ndoutputs.size(); ++j) {
if (ndoutputs[j]->shape().ndim() == 0) {
if (ndoutputs[j]->shape().ndim() == -1) {
junrushao marked this conversation as resolved.
Show resolved Hide resolved
ndoutputs[j]->WaitToRead();
ndoutputs[j]->SetShapeFromChunk();
}
Expand Down