For code lines
- Convert the original string into a tensor and Vectorize the text using the correct vectorizer, you are converting texts not text (Starting two code line has this issue. Refer the image shared in the below pinned comment link.
Other code lines which are incorrect,
-
Initial hidden and cell states should be tensors of zeros with shape (1, UNITS)
-
Iterate for max_length iterations(The pinned comment has the solution to your incorrectly recalled iteration.)
-
If done then break out of the loop
Make sure you go through the pinned comment link which should then completely resolve issue for the grade cell in question here
In case you develop any new error, let me know.
Regards
DP