Skip to content

Commit 9fd5282

Browse files
committed
Added comments
1 parent 98f982e commit 9fd5282

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

keras/src/backend/openvino/numpy.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,8 @@ def median(x, axis=None, keepdims=False):
10761076
x_shape, ov_axis, ov_opset.constant([0], Type.i32).output(0)
10771077
).output(0)
10781078
else:
1079+
# where axis is tuple or list of integers, move 'axis' dims to the
1080+
# rightmost positions and flatten them
10791081
flattened = False
10801082
ov_axis = get_ov_output(axis)
10811083
x_rank = ov_opset.gather(
@@ -1127,6 +1129,8 @@ def median(x, axis=None, keepdims=False):
11271129
ov_opset.constant([0], Type.i32).output(0),
11281130
).output(0)
11291131

1132+
# negative axis values are incompatible with ov_opset.gather axis arguement,
1133+
# convert the values
11301134
if axis < 0:
11311135
x_rank = ov_opset.gather(
11321136
ov_opset.shape_of(x, Type.i32).output(0),

0 commit comments

Comments
 (0)