Skip to content

Commit

Permalink
Add aten::foreach_maximum and its variants (#1015)
Browse files Browse the repository at this point in the history
- _foreach_maximum.List
- _foreach_maximum.Scalar
- _foreach_maximum.ScalarList
- _foreach_maximum_.List
- _foreach_maximum_.Scalar
- _foreach_maximum_.ScalarList
  • Loading branch information
xytintel authored Oct 23, 2024
1 parent b640849 commit c0b191d
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions yaml/native/native_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,54 @@
XPU: foreach_tensor_clamp_max_scalarlist_kernel_xpu_
autogen: _foreach_clamp_max.ScalarList_out

# foreach_minimum/maximum dispatches to clamp_max/min
- func: _foreach_maximum.Scalar(Tensor[] self, Scalar scalar) -> Tensor[]
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
variants: function
dispatch:
CompositeExplicitAutograd: foreach_tensor_clamp_min_scalar_kernel_slow
XPU: foreach_tensor_clamp_min_scalar_kernel_xpu

- func: _foreach_maximum_.Scalar(Tensor(a!)[] self, Scalar scalar) -> ()
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
variants: function
dispatch:
CompositeExplicitAutograd: foreach_tensor_clamp_min_scalar_kernel_slow_
XPU: foreach_tensor_clamp_min_scalar_kernel_xpu_
autogen: _foreach_maximum.Scalar_out

# foreach_minimum/maximum dispatches to clamp_max/min
- func: _foreach_maximum.List(Tensor[] self, Tensor[] other) -> Tensor[]
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
variants: function
dispatch:
CompositeExplicitAutograd: foreach_tensor_clamp_min_list_kernel_slow
XPU: foreach_tensor_clamp_min_list_kernel_xpu

- func: _foreach_maximum_.List(Tensor(a!)[] self, Tensor[] other) -> ()
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
variants: function
dispatch:
CompositeExplicitAutograd: foreach_tensor_clamp_min_list_kernel_slow_
XPU: foreach_tensor_clamp_min_list_kernel_xpu_
autogen: _foreach_maximum.List_out

# foreach_minimum/maximum dispatches to clamp_max/min
- func: _foreach_maximum.ScalarList(Tensor[] self, Scalar[] scalars) -> Tensor[]
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
variants: function
dispatch:
CompositeExplicitAutograd: foreach_tensor_clamp_min_scalarlist_kernel_slow
XPU: foreach_tensor_clamp_min_scalarlist_kernel_xpu

- func: _foreach_maximum_.ScalarList(Tensor(a!)[] self, Scalar[] scalars) -> ()
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
variants: function
dispatch:
CompositeExplicitAutograd: foreach_tensor_clamp_min_scalarlist_kernel_slow_
XPU: foreach_tensor_clamp_min_scalarlist_kernel_xpu_
autogen: _foreach_maximum.ScalarList_out

# foreach_minimum dispatches to clamp_max
- func: _foreach_minimum.Scalar(Tensor[] self, Scalar scalar) -> Tensor[]
device_check: NoCheck # foreach kernels fall back to slow path when tensor are on different devices
Expand Down

0 comments on commit c0b191d

Please sign in to comment.