Skip to content

Commit

Permalink
fix: Make torch.pow frontend accept scalar input
Browse files Browse the repository at this point in the history
  • Loading branch information
hmahmood24 committed Sep 12, 2024
1 parent c11aeee commit fe60be9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ivy/functional/frontends/torch/pointwise_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ def positive(input, *, out=None):
@with_unsupported_dtypes({"2.2 and below": ("bool",)}, "torch")
@to_ivy_arrays_and_back
def pow(input, exponent, *, out=None):
# torch supports input not being a tensor as well
if not ivy.is_array(input):
input = torch_frontend.as_tensor(input).ivy_array

if not ivy.is_array(exponent):
if (
any(dtype in str(input.dtype) for dtype in ["int8", "int16"])
Expand Down

0 comments on commit fe60be9

Please sign in to comment.