Skip to content

Commit

Permalink
Added the fmax to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
AtriChatterjee1 committed Aug 4, 2023
1 parent e038141 commit 0e0da2b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ivy/functional/frontends/torch/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,9 @@ def atan2_(self, other):

def fmin(self, other):
return torch_frontend.fmin(self, other)

def fmax(self,other):
return torch_frontend.fmax(self,other)

@with_unsupported_dtypes({"2.0.1 and below": ("float16", "complex")}, "torch")
def trunc(self):
Expand Down
38 changes: 38 additions & 0 deletions ivy_tests/test_ivy/test_frontends/test_torch/test_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7828,6 +7828,44 @@ def test_torch_fmin(
on_device=on_device,
)

#fmax

@handle_frontend_method(
class_tree=CLASS_TREE,
init_tree="torch.tensor",
method_name="fmax",
dtype_and_x= helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
num_arrays=2,
),
)
def test_torch_fmax(
dtype_and_x,
frontend_method_data,
init_flags,
method_flags,
frontend,
on_device,
backend_fw,
):
input_dtype, x = dtype_and_x
helpers.test_frontend_method(
init_input_dtypes=input_dtype,
backend_to_test=backend_fw,
init_all_as_kwargs_np={
"data": x[0],
},
method_input_dtypes=input_dtype,
method_all_as_kwargs_np={
"other": x[1],
},
frontend_method_data=frontend_method_data,
init_flags=init_flags,
method_flags=method_flags,
frontend=frontend,
on_device=on_device,
)


# count_nonzero
@handle_frontend_method(
Expand Down

0 comments on commit 0e0da2b

Please sign in to comment.