Skip to content

Implements GraphBuilder for the graph_api #57

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 12 commits into from
Dec 25, 2023
Merged
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
Prev Previous commit
Next Next commit
better constant
  • Loading branch information
xadupre committed Dec 20, 2023
commit d00d823e57cfd872f478526da2706b48969a2cd6
6 changes: 6 additions & 0 deletions onnx_array_api/graph_api/graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ def _get_tensor_shape(
return tuple(att.floats)
if att.name == "value_ints":
return (len(att.ints),)
if att.name == "value":
t = onh.to_array(att.t)
return t.shape
raise TypeError(
f"Unexpected or unsupported scenario type {type(proto)}: {proto}."
)
Expand All @@ -190,6 +193,9 @@ def _get_tensor_type(self, proto: Union[NodeProto, TensorProto]) -> int:
return TensorProto.FLOAT
if att.name == "value_ints":
return TensorProto.INT64
if att.name == "value":
t = onh.to_array(att.t)
return oh.np_dtype_to_tensor_dtype(t.dtype)
raise ValueError(f"Unexpected type or value {type(proto)}: {proto}.")

def is_constant(self, name: str) -> bool:
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy