Program Listing for File binary_cross_entropy.h

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

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

#include "ops/primitive_c.h"
#include "ops/op_utils.h"
#include "abstract/abstract_value.h"
#include "utils/check_convert_utils.h"

namespace mindspore {
namespace ops {
constexpr auto kNameBinaryCrossEntropy = "BinaryCrossEntropy";
class MS_CORE_API BinaryCrossEntropy : public PrimitiveC {
 public:
  BinaryCrossEntropy() : PrimitiveC(kNameBinaryCrossEntropy) {}
  ~BinaryCrossEntropy() = default;
  MS_DECLARE_PARENT(BinaryCrossEntropy, PrimitiveC);
  void Init(const Reduction &reduction = MEAN);
  void set_reduction(const Reduction &reduction);
  Reduction get_reduction() const;
};
AbstractBasePtr BinaryCrossEntropyGradInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive,
                                            const std::vector<AbstractBasePtr> &input_args);
}  // namespace ops
}  // namespace mindspore
#endif  // MINDSPORE_CORE_OPS_BINARY_CROSS_ENTROPY_H_