Skip to content
Permalink
Browse files Browse the repository at this point in the history
Ensure non-empty compressed input in tf.raw_ops.UncompressElement
PiperOrigin-RevId: 383955815
Change-Id: I072a84fd02738dd2f51b3f42836ed80067dba4a8
  • Loading branch information
pak-laura authored and tensorflower-gardener committed Jul 10, 2021
1 parent a21a122 commit 7bdf50b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/kernels/data/experimental/compression_ops.cc
Expand Up @@ -48,6 +48,11 @@ void UncompressElementOp::Compute(OpKernelContext* ctx) {
Tensor tensor = ctx->input(0);
const Variant& variant = tensor.scalar<Variant>()();
const CompressedElement* compressed = variant.get<CompressedElement>();
OP_REQUIRES(
ctx, compressed != nullptr,
errors::InvalidArgument(
"Input does not contain a compressed element. Instead got tensor ",
tensor.DebugString()));

std::vector<Tensor> components;
OP_REQUIRES_OK(ctx, UncompressElement(*compressed, &components));
Expand Down

0 comments on commit 7bdf50b

Please sign in to comment.