Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
caffe2
operators
negate_gradient_op.h
1
// Copyright 2004-present Facebook. All Rights Reserved.
2
3
// File: negate_gradient_op.h
4
5
#pragma once
6
#include "caffe2/core/context.h"
7
#include "caffe2/core/operator.h"
8
9
namespace
caffe2
{
10
11
template
<
class
Context>
12
class
NegateGradientOp
final :
public
Operator
<Context> {
13
public
:
14
USE_SIMPLE_CTOR_DTOR(
NegateGradientOp
)
15
USE_OPERATOR_CONTEXT_FUNCTIONS;
16
17
bool
RunOnDevice()
override
{
18
const
auto
& in =
Input
(0);
19
auto
* out = Output(0);
20
if
(out != &in) {
21
out->CopyFrom(in,
/* async */
true
);
22
}
23
return
true
;
24
}
25
};
26
27
}
// namespace caffe2
caffe2::NegateGradientOp
Definition:
negate_gradient_op.h:12
caffe2::Operator::Input
const Tensor & Input(int idx, DeviceType type=Context::GetDeviceType())
Retrieve a non-owning reference to the input at position 'idx' for this operator. ...
Definition:
operator.h:702
caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition:
blob.h:13
caffe2::Operator
Definition:
operator.h:677
Generated on Thu Mar 21 2019 13:06:18 for Caffe2 - C++ API by
1.8.11