Week 3, C3W3_Assignment in section 4-5, classify and evaluate, How to pass the tf.data.Dataset.from_tensor_slices output to model, to get the prediction

You asked about pred first. now you are asking a different query.

please be specific about your issue. You aren’t suppose to use expand_dim at all to get pred. You are referring the week 2 first grade cell codes but

check what I mentioned in my previous comment? I stated to get model output using the sentence_vectorized? when did you use this code to get model output? not where we try to convert IDs to tensor, check the grade cell where you predict word. go through the Assignments carefully.

or refer the below link where arvy mention the same function you need to use to get pred using test_gen