Esempio n. 1
0
        /// <summary>
        /// Return zero-filled state tensor(s).
        /// </summary>
        /// <param name="batch_size"></param>
        /// <param name="dtype"></param>
        /// <returns></returns>
        private LSTMStateTuple zero_state(Tensor batch_size, TF_DataType dtype)
        {
            LSTMStateTuple output = null;

            tf_with(ops.name_scope($"{GetType().Name}ZeroState", values: new { batch_size }), delegate
            {
                output = _zero_state_tensors(state_size, batch_size, dtype);
            });

            return(output);
        }
Esempio n. 2
0
 public Tensor[] __call__(Tensor inputs, LSTMStateTuple state)
 {
     _state = state;
     return(base.__call__(inputs));
 }