Skip to content

Commit 09d71ef

Browse files
committed
git_global_in renamed get_first_global_in for clarity, same for _out
1 parent d04afda commit 09d71ef

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/qonnx/core/modelwrapper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,12 +541,12 @@ def get_all_tensor_names(self):
541541
names += [x.name for x in graph.output]
542542
return names
543543

544-
def get_global_in(self):
545-
"""Return the name of the global input tensor."""
544+
def get_first_global_in(self):
545+
"""Return the name of the first global input tensor."""
546546
return self.graph.input[0].name
547547

548-
def get_global_out(self):
549-
"""Return the name of the global output tensor."""
548+
def get_first_global_out(self):
549+
"""Return the name of the first global output tensor."""
550550
return self.graph.output[0].name
551551

552552
def make_new_valueinfo_name(self):

tests/core/test_modelwrapper.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ def test_modelwrapper_get_global_io():
275275
onnx_model = qonnx_make_model(graph, producer_name="global-io-test-model")
276276
model = ModelWrapper(onnx_model)
277277

278-
# Test get_global_in
279-
assert model.get_global_in() == "global_in"
278+
# Test get_first_global_in
279+
assert model.get_first_global_in() == "global_in"
280280

281-
# Test get_global_out
282-
assert model.get_global_out() == "global_out"
281+
# Test get_first_global_out
282+
assert model.get_first_global_out() == "global_out"
283283

284284
# Test with multi-input model (should still return first input)
285285
in2 = onnx.helper.make_tensor_value_info("second_in", onnx.TensorProto.FLOAT, [1, 4])
@@ -294,5 +294,5 @@ def test_modelwrapper_get_global_io():
294294
model_multi = ModelWrapper(onnx_model_multi)
295295

296296
# Should still return first input/output
297-
assert model_multi.get_global_in() == "global_in"
298-
assert model_multi.get_global_out() == "global_out"
297+
assert model_multi.get_first_global_in() == "global_in"
298+
assert model_multi.get_first_global_out() == "global_out"

0 commit comments

Comments
 (0)