message: Avoid constant-folding for ops that produce variants.
  This is generally a lossy transformation since it results in opaque proto blobs that can only be handled by the TensorFlow runtime. If we need any of these transformations, we should add a separate pass that does them.
diff: @@ -19,6 +19,7 @@ limitations under the License.
  #include "tensorflow/c/eager/c_api.h"
  #include "tensorflow/c/tf_status.h"
  +#include "tensorflow/compiler/mlir/tensorflow/ir/tf_types.h"
  #include "tensorflow/compiler/mlir/tensorflow/utils/eval_util.h"
  #include "tensorflow/core/platform/mutex.h"
  @@ -32,6 +33,17 @@ LogicalResult ConstantFoldFallbackHook(
  // the original semantics.
  if (!inst->hasNoSideEffect()) return failure();
  + // If any of the result types are variants, don't try to constant fold them.
  + // This creates opaque variant constants which lose information and would
  + // require "raising" later.
  + for (auto& type : inst->getResultTypes()) {
  + if (auto tensor_type = type.dyn_cast<TensorType>()) {
  + if (tensor_type.getElementType().isa<VariantType>()) {
  + return failure();
  + }
  + }
  + }
  +
  // TODO(jpienaar): Currently this persists the entire program execution. This
  // should instead be per module/set from the Graph being executed in TF (if
  // any) so that the value of variables in the context could be read.
  