#include <ATen/native/ForeachUtils.h>
#include "op_plugin/OpApiInterface.h"
#include "op_plugin/utils/op_api_common.h"
namespace op_api {
using npu_preparation = at_npu::native::OpPreparation;
at::Tensor bucketize(const at::Tensor& self, const at::Tensor& boundaries, bool out_int32, bool right)
{
TORCH_CHECK(boundaries.dim() == 1, "boundaries tensor must be 1 dimension, but got dim(",
boundaries.dim(), ")" + OPS_ERROR(ErrCode::PARAM));
return op_api::searchsorted(boundaries, self, out_int32, right, c10::nullopt, c10::nullopt);
}
at::Tensor bucketize(const at::Scalar& self, const at::Tensor& boundaries, bool out_int32, bool right)
{
TORCH_CHECK(boundaries.dim() == 1, "boundaries tensor must be 1 dimension, but got dim(", boundaries.dim(),
")" + OPS_ERROR(ErrCode::PARAM));
return op_api::searchsorted(boundaries, self, out_int32, right, c10::nullopt, c10::nullopt);
}
at::Tensor &bucketize_out(
const at::Tensor& self,
const at::Tensor& boundaries,
bool out_int32,
bool right,
at::Tensor& out)
{
TORCH_CHECK(boundaries.dim() == 1, "boundaries tensor must be 1 dimension, but got dim(", boundaries.dim(),
")" + OPS_ERROR(ErrCode::PARAM));
return op_api::searchsorted_out(boundaries, self, out_int32, right, c10::nullopt, c10::nullopt, out);
}
}