Skip to content

Fix graph rendering issue for tensors with zero dimension size #6420

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

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Changes from all commits
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: 4 additions & 1 deletion tensorboard/plugins/graph/tf_graph_common/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,10 @@ function extractOutputShapes(
// into a number.
return shape.dim.map((dim) => {
// Size can be -1 if this particular dimension is unknown.
return dim.size;
// If we actually have a 0-dimension tensor `dim.size` returns null,
// so we default to 0 in this case to avoid upstream null-handling
// issues.
return dim.size || 0;
});
});
// Since we already processed it, remove the entry from the attribute
Expand Down