Skip to content

Commit

Permalink
Fix tensor size limit display
Browse files Browse the repository at this point in the history
  • Loading branch information
justinchuby committed May 20, 2024
1 parent 847c917 commit 66023bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model_explorer_onnx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def display_tensor_json(tensor: ir.TensorProtocol | None, settings: Settings) ->
try:
array = _tensor_to_numpy(tensor)
size_limit = settings.const_element_count_limit
if size_limit < 0 or size_limit > array.size:
if size_limit < 0 or size_limit >= array.size:
# Use separators=(',', ':') to remove spaces
return json.dumps(array.tolist(), separators=(",", ":"))
# Show the first `size_limit` elements if the tensor is too large
Expand Down

0 comments on commit 66023bd

Please sign in to comment.