Esempio n. 1
0
        public AutoCond(AutoTFOutput predicate, Func <T> if_true, Func <T> if_false, TFSession session)
        {
            TupleRank     = typeof(T).GetGenericArguments().Length;
            TupleSubtypes = typeof(T).GetGenericArguments();

            _predicate = predicate;
            _if_true   = if_true;
            _if_false  = if_false;
            _session   = session;
        }
Esempio n. 2
0
 private static TFSession GetSession(AutoTFOutput a, AutoTFOutput b)
 {
     if (a._session == null && b._session == null)
     {
         throw new Exception("Cannot calculate graph of two non-tensor values. At least one operant has to be a Tensor");
     }
     if (a._session == null)
     {
         a._session = b._session;
     }
     if (b._session == null)
     {
         b._session = a._session;
     }
     return(a._session);
 }
Esempio n. 3
0
 public void Deconstruct(out AutoTFOutput c, out AutoTFOutput a)
 {
     throw new NotImplementedException();
 }
Esempio n. 4
0
        public void Deconstruct(out AutoTFOutput a)
        {
            var condResult = _session.Graph.Cond(_predicate, () => (_if_true() as Tuple <AutoTFOutput>).Item1, () => (_if_false() as Tuple <AutoTFOutput>).Item1);

            a = new AutoTFOutput(condResult, _session) as AutoTFOutput;
        }