Example #1
0
        public override TorchTensor Forward(TorchTensor tensor)
        {
            if (!Modules.Any())
            {
                throw new ArgumentException("Cannot do forward pass over empty Sequence module.");
            }

            var(head, tail) = Modules;
            var result = head.Forward(tensor);

            foreach (var module in tail)
            {
                result = module.Forward(result);
            }

            return(result);
        }