* 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.
*/
* \file sparse_apply_proximal_adagrad_proto.h
* \brief
*/
#ifndef OPS_OP_PROTO_INC_SPARSE_APPLY_PROXIMAL_ADAGRAD_H_
#define OPS_OP_PROTO_INC_SPARSE_APPLY_PROXIMAL_ADAGRAD_H_
#include "graph/operator_reg.h"
#include "graph/types.h"
namespace ge {
*@brief Updates var and accum by applying ProximalAdagrad algorithm for sparse indices.
*@par Inputs:
*Seven inputs, including:
* @li var: A ND Tensor. Must be one of the following types: float32, float16, bfloat16.
* @li accum: A ND Tensor. Must be one of the following types: float32, float16, bfloat16.
* @li lr: A scalar Tensor. Must be one of the following types: float32, float16, bfloat16.
* @li l1: A scalar Tensor. Must be one of the following types: float32, float16, bfloat16.
* @li l2: A scalar Tensor. Must be one of the following types: float32, float16, bfloat16.
* @li grad: A ND Tensor. Must be one of the following types: float32, float16, bfloat16.
* @li indices: A 1D Tensor. Must be one of the following types: int32, int64. \n
*@par Outputs:
*var: A ND Tensor. Must be one of the following types: float32, float16, bfloat16.
*accum: A ND Tensor. Must be one of the following types: float32, float16, bfloat16.
*@par Third-party framework compatibility
*Compatible with the TensorFlow operator SparseApplyProximalAdagrad.
*/
REG_OP(SparseApplyProximalAdagrad)
.INPUT(var, TensorType::NumberType())
.INPUT(accum, TensorType::NumberType())
.INPUT(lr, TensorType::NumberType())
.INPUT(l1, TensorType::NumberType())
.INPUT(l2, TensorType::NumberType())
.INPUT(grad, TensorType::NumberType())
.INPUT(indices, TensorType::IndexNumberType())
.OUTPUT(var, TensorType::NumberType())
.OUTPUT(accum, TensorType::NumberType())
.ATTR(use_locking, Bool, false)
.OP_END_FACTORY_REG(SparseApplyProximalAdagrad)
}
#endif