Program Listing for File smooth_l1_loss.h

Return to documentation for file (include/converter/include/ops/smooth_l1_loss.h)

#ifndef MINDSPORE_CORE_OPS_SMOOTH_L1_LOSS_H_
#define MINDSPORE_CORE_OPS_SMOOTH_L1_LOSS_H_
#include <memory>
#include <string>
#include <vector>

#include "mindapi/base/types.h"
#include "ops/base_operator.h"

namespace mindspore {
namespace ops {
constexpr auto kNameSmoothL1Loss = "SmoothL1Loss";
class MIND_API SmoothL1Loss : public BaseOperator {
 public:
  MIND_API_BASE_MEMBER(SmoothL1Loss);
  SmoothL1Loss() : BaseOperator(kNameSmoothL1Loss) { InitIOName({"prediction", "target"}, {"output"}); }
  void Init(const float beta, const std::string reduction = "none");
  void set_beta(const float beta);
  float get_beta() const;
  void set_reduction(const std::string reduction);
  std::string get_reduction() const;
};
MIND_API abstract::AbstractBasePtr SmoothL1LossInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive,
                                                     const std::vector<abstract::AbstractBasePtr> &input_args);
using kPrimSmoothL1LossPtr = std::shared_ptr<SmoothL1Loss>;
}  // namespace ops
}  // namespace mindspore

#endif  // MINDSPORE_CORE_OPS_SMOOTH_L1_LOSS_H_