/**
 * Copyright (c) 2026 Huawei Technologies Co., Ltd.
 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
 * CANN Open Software License Agreement Version 2.0 (the "License").
 * Please refer to the License for details. You may not use this file except in compliance with the License.
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
 * See LICENSE in the root of the software repository for the full text of the License.
 */

/* Generated By CANNBot */

/*!
 * \file acts_ulq_input_grad_proto.h
 * \brief ActsULQInputGrad 算子原型(GEIR OpDef + InferShape/Verify,v2.0 图模式对外调用通路)
 *
 * x_grad = y_grad * clamp_min_mask * clamp_max_mask(逐元素门控乘法)
 * v2.0:调用形态为图模式(GE 图,直调 ge::op::ActsULQInputGrad)。dtype 域:y_grad
 *       fp16/fp32;mask bool/fp16/fp32。合法组合 4 组(mask 浮点须与 y_grad 同 dtype
 *       或为 bool),由 Tiling/Verify 校验;混合浮点组合已移除。
 */
#ifndef OPS_OP_PROTO_INC_ACTS_ULQ_INPUT_GRAD_H_
#define OPS_OP_PROTO_INC_ACTS_ULQ_INPUT_GRAD_H_

#include "graph/operator_reg.h"
#include "graph/types.h"

namespace ge {

/**
*@brief Returns y_grad * clamp_min_mask * clamp_max_mask (elementwise STE clamp gradient gate).
*@par Inputs:
*Three inputs, including:
* @li y_grad: An ND Tensor. Must be one of the following types: float16, float32.
* @li clamp_min_mask: An ND Tensor. Must be one of the following types: bool, float16, float32.
* @li clamp_max_mask: An ND Tensor. Must be one of the following types: bool, float16, float32. \n

*@par Outputs:
*x_grad: An ND Tensor. Must be one of the following types: float16, float32 (same as y_grad).
*@par Third-party framework compatibility
*Compatible with the MindSpore ULQ backward operator.
*/
REG_OP(ActsULQInputGrad)
    .INPUT(y_grad, TensorType({DT_FLOAT16, DT_FLOAT}))
    .INPUT(clamp_min_mask, TensorType({DT_BOOL, DT_FLOAT16, DT_FLOAT}))
    .INPUT(clamp_max_mask, TensorType({DT_BOOL, DT_FLOAT16, DT_FLOAT}))
    .OUTPUT(x_grad, TensorType({DT_FLOAT16, DT_FLOAT}))
    .OP_END_FACTORY_REG(ActsULQInputGrad)

} // namespace ge

#endif // OPS_OP_PROTO_INC_ACTS_ULQ_INPUT_GRAD_H_