Пример #1
0
        public _FetchHandler(Graph graph, object fetches, Dictionary <object, object> feeds = null, Action feed_handles = null)
        {
            _fetch_mapper = _FetchMapper.for_fetch(fetches);
            foreach (var fetch in _fetch_mapper.unique_fetches())
            {
                switch (fetch)
                {
                case Operation val:
                    _assert_fetchable(graph, val);
                    _targets.Add(val);
                    _ops.Add(true);
                    break;

                case Tensor val:
                    _assert_fetchable(graph, val.op);
                    _fetches.Add(val);
                    _ops.Add(false);
                    break;

                default:
                    throw new NotImplementedException("_FetchHandler fetch");
                }
            }

            _final_fetches = _fetches;
        }