Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CherryPick]Fix 2 issues with . #49838

Merged
merged 1 commit into from
May 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions tensorflow/core/kernels/conv_ops_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ struct LaunchConvOp<CPUDevice, T, OpKernelContextT> {
errors::InvalidArgument("CPU implementation of Conv3D "
"currently only supports dilated rates "
"of 1."));
OP_REQUIRES(context, filter.dim_size(3) == input.dim_size(input.dims() - 1),
errors::InvalidArgument(
"Number of channels in filter (", filter.dim_size(3),
") must match last dimension of input (",
input.dim_size(input.dims() - 1), ")"));
functor::CuboidConvolution<CPUDevice, T>()(
context->template eigen_device<CPUDevice>(), output->tensor<T, 5>(),
input.tensor<T, 5>(), filter.tensor<T, 5>(), strides[2], strides[1],
Expand Down Expand Up @@ -135,6 +140,8 @@ class Conv3DOp : public BinaryOpBase<T, OpKernelT, OpKernelConstructionT> {
const int64 filter_depth = filter.dim_size(3);
const int64 out_depth = filter.dim_size(4);

OP_REQUIRES(context, filter_depth != 0,
errors::InvalidArgument("filter_depth must be non-zero"));
OP_REQUIRES(context, in_depth % filter_depth == 0,
errors::InvalidArgument(
"Input depth must be evenly divisible by filter depth: ",
Expand Down