diff --git a/dali/tensorflow/daliop.cc b/dali/tensorflow/daliop.cc index c1aeee8dea5..1fd85e657c4 100644 --- a/dali/tensorflow/daliop.cc +++ b/dali/tensorflow/daliop.cc @@ -65,6 +65,8 @@ REGISTER_OP("Dali") .Attr("prefetch_queue_depth: int = 2") .Output("data: dtypes") .Attr("dtypes: list({half, float, uint8, int16, int32, int64}) >= 1") + // To prevent replacing DALI op with constant tensor during TF constant folding process + .SetIsStateful() .SetShapeFn([](tf::shape_inference::InferenceContext* c) { std::vector shapes; TF_RETURN_IF_ERROR(c->GetAttr("shapes", &shapes));