Skip to content

fix parsing issue of arrays for a webnn graph like below#11

Merged
mtavenrath merged 1 commit intomainfrom
concat
Apr 11, 2026
Merged

fix parsing issue of arrays for a webnn graph like below#11
mtavenrath merged 1 commit intomainfrom
concat

Conversation

@mtavenrath
Copy link
Copy Markdown
Contributor

webnn_graph "model" v1 {
inputs { tensors_0: f32[2, 3, 4, 5]; tensors_1: f32[2, 3, 4, 5]; }
nodes {
[operand_1] = concat([tensors_0, tensors_1], axis=0);
}
outputs { operand_1; }
}

@mtavenrath mtavenrath requested a review from tarekziade April 9, 2026 23:17
Comment thread src/parser.rs Outdated
inputs.push(s);
} else if let Some(sym) = v.as_str() {
inputs.push(sym.to_string());
// Always parse through `parse_value`: with silent `literal` in the grammar,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this comment with

// Handle bracketed input lists like `concat([a, b], ...)`: `parse_value`
// returns `Value::Array` for `[a, b]`, which we flatten into individual inputs.

Copy link
Copy Markdown
Collaborator

@tarekziade tarekziade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit on the comment

webnn_graph "model" v1 {
  inputs { tensors_0: f32[2, 3, 4, 5]; tensors_1: f32[2, 3, 4, 5]; }
  nodes {
	[operand_1] = concat([tensors_0, tensors_1], axis=0);
  }
  outputs { operand_1; }
}
@mtavenrath mtavenrath merged commit f0f8bbc into main Apr 11, 2026
0 of 3 checks passed
@mtavenrath mtavenrath deleted the concat branch April 11, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants