aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/conv_grad_ops_3d.cc
diff options
context:
space:
mode:
authorGravatar Peter Hawkins <phawkins@google.com>2017-03-06 12:21:14 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-03-06 12:50:39 -0800
commit19dd9342e7bc55c877367b7474caf41e819e38c3 (patch)
treeb9878ab58e0d3575a4bba12ff8dc091787f1e8f5 /tensorflow/core/kernels/conv_grad_ops_3d.cc
parent5f1976d08346f2e444679ee902d5a8b00c2ab95a (diff)
[TF:XLA] Add support for 3D convolution to XLA bridge.
Generalize common backward convolution dimension computation code to support > 2 dimensions. Fix crash for zero-element Tensors passed to Conv3DBackpropFilter on CPU. Change: 149329330
Diffstat (limited to 'tensorflow/core/kernels/conv_grad_ops_3d.cc')
-rw-r--r--tensorflow/core/kernels/conv_grad_ops_3d.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/conv_grad_ops_3d.cc b/tensorflow/core/kernels/conv_grad_ops_3d.cc
index 65ea783cd4..df7e743b69 100644
--- a/tensorflow/core/kernels/conv_grad_ops_3d.cc
+++ b/tensorflow/core/kernels/conv_grad_ops_3d.cc
@@ -260,6 +260,11 @@ class Conv3DBackpropFilterOp : public OpKernel {
OP_REQUIRES_OK(context,
context->allocate_output(0, filter_shape, &filter_backprop));
+ if (input_shape.num_elements() == 0) {
+ filter_backprop->template flat<T>().setZero();
+ return;
+ }
+
// For the backprop of the filter, we need to also transpose the
// out_backprop.
// The shape of backprop is