Пример #1
0
        public IEnumerator <(Tensor, Tensor)> GetEnumerator()
        {
            using var ownedIterator = new OwnedIterator(this);

            Tensor[] results = null;
            while (true)
            {
                try
                {
                    results = ownedIterator.next();
                }
                catch (StopIteration)
                {
                    break;
                }

                yield return(results[0], results.Length == 1 ? null : results[1]);
            }
        }
Пример #2
0
        public IEnumerator <(Tensor, Tensor)> GetEnumerator()
        {
            var ownedIterator = new OwnedIterator(this);

            bool stop = false;

            Tensor[] results = null;
            while (!stop)
            {
                try
                {
                    results = ownedIterator.next();
                }
                catch (StopIteration)
                {
                    stop = true;
                }

                yield return(results[0], results[1]);
            }
        }