Program Listing for File nllloss.h

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

#ifndef MINDSPORE_CORE_OPS_NLLLOSS_H_
#define MINDSPORE_CORE_OPS_NLLLOSS_H_

#include <string>
#include <vector>
#include <memory>
#include "ops/base_operator.h"
#include "mindapi/base/types.h"

namespace mindspore {
namespace ops {
constexpr auto kNameNLLLoss = "NLLLoss";
class MIND_API NLLLoss : public BaseOperator {
 public:
  MIND_API_BASE_MEMBER(NLLLoss);
  NLLLoss() : BaseOperator(kNameNLLLoss) { InitIOName({"logits", "labels", "weight"}, {"loss", "total_weight"}); }

  void Init(const Reduction &reduction = Reduction::NONE);

  void set_reduction(const Reduction &reduction);

  Reduction get_reduction() const;
};
}  // namespace ops
}  // namespace mindspore
#endif  // MINDSPORE_CORE_OPS_NLLLOSS_H_