Skip to content

Commit c249424

Browse files
committed
refactor: correct dtype usage
Signed-off-by: 11happy <[email protected]>
1 parent 19d3358 commit c249424

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

keras/src/backend/openvino/numpy.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,13 @@ def average(x, axis=None, weights=None):
323323

324324
def bincount(x, weights=None, minlength=0, sparse=False):
325325
x = get_ov_output(x)
326+
x_type = x.get_element_type()
326327
weights = get_ov_output(weights)
328+
weights = ov_opset.convert(weights, x_type).output(0)
327329
minlength = get_ov_output(minlength)
328-
const_one = ov_opset.constant(1, Type.i64).output(0)
329-
const_zero = ov_opset.constant(0, Type.i64).output(0)
330+
minlength = ov_opset.convert(minlength, x_type).output(0)
331+
const_one = ov_opset.constant(1, x_type).output(0)
332+
const_zero = ov_opset.constant(0, x_type).output(0)
330333
max_element = ov_opset.reduce_max(x, const_zero, keep_dims=False).output(0)
331334
depth = ov_opset.add(max_element, const_one).output(0)
332335
depth = ov_opset.maximum(depth, minlength).output(0)

0 commit comments

Comments
 (0)