From 2dfff75d0caec8f92038a1eebd925d970dbf3aa4 Mon Sep 17 00:00:00 2001 From: Rahul Jha <68377773+rahul-deepsource@users.noreply.github.com> Date: Thu, 1 Oct 2020 11:10:50 +0530 Subject: [PATCH] Update onnx2xla.py --- examples/onnx2xla.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/onnx2xla.py b/examples/onnx2xla.py index 196ab1c03b53..c7a180abed8e 100644 --- a/examples/onnx2xla.py +++ b/examples/onnx2xla.py @@ -94,8 +94,14 @@ def onnx_add(a, b, axis=None, broadcast=True): def interpret_onnx(graph, *args): - vals = dict({n.name: a for n, a in zip(graph.input, args)}, - **{n.name: _asarray(n) for n in graph.initializer}) + vals = **( + { + n.name: a for n, a in zip(graph.input, args) + }, + { + n.name: _asarray(n) for n in graph.initializer + }, + ) for node in graph.node: args = (vals[name] for name in node.input) attrs = {a.name: attribute_handlers[a.type](a) for a in node.attribute}