Skip to content

Commit 86b4b40

Browse files
[OpenVINO Backend] support __rpow__ for OpenVINOKerasTensor (#21347)
1 parent 43e9a2e commit 86b4b40

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

keras/src/backend/openvino/core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ def __pow__(self, other):
249249
)
250250
return OpenVINOKerasTensor(ov_opset.power(first, other).output(0))
251251

252+
def __rpow__(self, other):
253+
other = get_ov_output(other)
254+
first = self.output
255+
first, other = align_operand_types(
256+
first, other, "OpenVINOKerasTensor::__rpow__"
257+
)
258+
return OpenVINOKerasTensor(ov_opset.power(other, first).output(0))
259+
252260
def __getitem__(self, indices):
253261
# now it has limited functionaly
254262
# and supports only a case with one integer index in indices

0 commit comments

Comments
 (0)