diff options
author | RJ Ryan <rjryan@google.com> | 2016-07-12 23:19:39 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-07-13 00:32:20 -0700 |
commit | 35df3ed43edabbc4ad1b2439bbc7de8917026d6e (patch) | |
tree | 8898a5bdbf2363131f49617a02baebe378f17ebd /tensorflow/stream_executor/dnn.h | |
parent | 8e69f9864fcdab1e7b9f4d9ff86d27491f3877fc (diff) |
Roll-forward of "Local Response Normalization GPU support via Stream Executor."
Move AsDeviceMemory function into a StreamExecutorUtil class, not a GPUUtil one, since it's independent of GPUs. Make lrn_op use the new version of that function.
Change: 127289319
Diffstat (limited to 'tensorflow/stream_executor/dnn.h')
-rw-r--r-- | tensorflow/stream_executor/dnn.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tensorflow/stream_executor/dnn.h b/tensorflow/stream_executor/dnn.h index f53ec21530..c2310c8938 100644 --- a/tensorflow/stream_executor/dnn.h +++ b/tensorflow/stream_executor/dnn.h @@ -1081,6 +1081,43 @@ class DnnSupport { const DeviceMemory<float>& input_data, DeviceMemory<float>* output_data) = 0; + // Applies local response normalization to the values from input_data and + // writes the result to output_data. + // + // Similar to DoNormalize, but normalizes across feature maps and allows for + // specifying the dimensions of the tensor. + // + // See comments on NormalizeDescriptor for a description of local response + // normalization. + virtual bool DoNormalizeWithDimensions( + Stream* stream, const dnn::NormalizeDescriptor& normalize_descriptor, + const dnn::BatchDescriptor& dimensions, + const DeviceMemory<float>& input_data, DeviceMemory<float>* output_data) { + return false; + } + + // Performs backpropagation for the normalization operation + // + // Given raw data, its corresponding normalized output, and a gradient of some + // unspecified function with respect to the normalized variables, computes the + // gradient of that unspecified function with respect to the raw variables. + // + // The normalized data input array is expected to match the output that would + // be obtained by running the raw data input array through the DoNormalize + // method above. + // + // See comments on NormalizeDescriptor for a description of local response + // normalization. + virtual bool DoNormalizeBackwardWithDimensions( + Stream* stream, const dnn::NormalizeDescriptor& normalize_descriptor, + const dnn::BatchDescriptor& dimensions, + const DeviceMemory<float>& raw_data, + const DeviceMemory<float>& normalized_data, + const DeviceMemory<float>& normalized_variable_gradient, + DeviceMemory<float>* raw_variable_gradient) { + return false; + } + // Applies an activation function (see ActivationMode) to all of the values // held on the device in 'input_data', whose dimensions are described by // 'dimensions'. |