Defining optional inputs in CoreML for recurrent network

I have recently stumbled upon an article on the CoreML docs site that discusses an implementation of a recurrent model for predicting text. I am trying to replicate this, or at least something similar, and have hit a wall as to how the author was able to define the "stateIn" input in the model as optional. Does anyone have any info that may point me in the right direction? I'm building the network using keras and plan on converting to CoreML after training.


The process used in this article would apply perfectly to my model. Outputting the state and passing it back into the model for the next item in the sequence seems like a great approach, however I am unclear on how this is achievable using CoreML.


Any information or help would be greatly appreciated!


Thanks ahead of time


Link to the article:

https://developer.apple.com/documentation/coreml/core_ml_api/making_predictions_with_a_sequence_of_inputs