output_descriptor
Descriptors of the output, hidden output, and cell-state output data.
Declaration
var output_descriptor: BNNSLSTMDataDescriptorDiscussion
You must define the layout of this descriptor as one of either:
BNNSDataLayoutSNE with the shape (num_directions*hidden_size,batch_size,seq_len)
BNNSDataLayoutNSE with the shape (num_directions*hidden_size,seq_len,batch_size)
BNNS can upack the first dimension as a 2D array with hidden_size as the major dimension. That is, BNNS can interpret the dimension as a C array with the shape [num_directions][ hidden_size ].
If lstm_flags includes BNNSLayerFlagsLSTMBidirectional, BNNS defines num_directions as 2, or otherwise 1.
If you don’t specify a layout, BNNS uses BNNSDataLayoutSNE.
Use C style multidimensional array notation to define the hierarchy of the hidden_desc and cell_state_desc descriptors as [num_layers][num_directions][batch_size][hidden_size].