message: Only apply size limit if size of tensor is increasing
diff: @@ -913,6 +913,7 @@ Status ConstantFolding::CreateNodeDef(const string& name,
  AttrValue attr_tensor;
  TensorProto* t = attr_tensor.mutable_tensor();
  bool optimized = false;
  + const size_t original_size = tensor->TotalBytes();
  size_t encoded_size;
  // Use the packed representation whenever possible to avoid generating large
  // graphdefs. Moreover, avoid repeating the last values if they're equal.
  @@ -980,12 +981,12 @@ Status ConstantFolding::CreateNodeDef(const string& name,
  }
  node->mutable_attr()->insert({"value", attr_tensor});
  - if (encoded_size < 10 * 1024 * 1024) {
  - return Status::OK();
  - }
  + if (encoded_size > original_size && encoded_size >= 10 * 1024 * 1024) {
  return errors::InvalidArgument(
  strings::StrCat("Can't fold ", name, ", its size would be too large"));
  }
  + return Status::OK();
  +}
  Status ConstantFolding::EvaluateNode(const NodeDef& node,
  const TensorVector& inputs,
  