예제 #1
0
 def facet_avg(self, o, a):
     # Facet average of a single function and differentiation commutes.
     f, fp = a
     o = self.reuse_if_possible(o, f)
     if isinstance(fp, ConstantValue):
         return (o, fp) # TODO: Necessary? Can't FacetAvg simplify directly instead?
     else:
         return (o, facet_avg(fp))
예제 #2
0
 def facet_avg(self, o, a):
     # Facet average of a single function and differentiation commutes.
     f, fp = a
     o = self.reuse_if_possible(o, f)
     if isinstance(fp, ConstantValue):
         return (
             o, fp
         )  # TODO: Necessary? Can't FacetAvg simplify directly instead?
     else:
         return (o, facet_avg(fp))
예제 #3
0
 def facet_avg(self, o, fp):
     # Facet average of a single function and differentiation
     # commutes, D_f[v](facet_avg(f)) = facet_avg(v)
     return facet_avg(fp)
예제 #4
0
 def facet_avg(self, o, fp):
     # Facet average of a single function and differentiation
     # commutes, D_f[v](facet_avg(f)) = facet_avg(v)
     return facet_avg(fp)