mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-11 22:34:53 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17090 clangr codemod Reviewed By: ezyang Differential Revision: D14078550 fbshipit-source-id: 68e6de4298e55ce83039b7806c1a275c4d6593c8
27 lines
602 B
C++
27 lines
602 B
C++
#pragma once
|
|
#include "caffe2/core/context.h"
|
|
#include "caffe2/core/operator.h"
|
|
|
|
namespace caffe2 {
|
|
|
|
template <class Context>
|
|
class WeightedMultiSamplingOp : public Operator<Context> {
|
|
public:
|
|
USE_OPERATOR_CONTEXT_FUNCTIONS;
|
|
|
|
template <class... Args>
|
|
explicit WeightedMultiSamplingOp(Args&&... args)
|
|
: Operator<Context>(std::forward<Args>(args)...),
|
|
num_samples_(
|
|
this->template GetSingleArgument<int64_t>("num_samples", 0)) {
|
|
CAFFE_ENFORCE_GE(num_samples_, 0);
|
|
}
|
|
|
|
bool RunOnDevice() override;
|
|
|
|
private:
|
|
const int64_t num_samples_;
|
|
};
|
|
|
|
} // namespace caffe2
|