@register_canonicalize('fast_compile')
@register_useless
@gof.local_optimizer([T.fill])
def local_useless_fill(node):
 if (node.op == T.fill):
  (r, v) = node.inputs
  if (v.type == node.outputs[0].type):
   return [v]

@ register_canonicalize ( 'fast_compile' ) @ register_useless @ gof . local_optimizer ( [ T . fill ] ) def local_useless_fill ( node ) : if ( node . op == T . fill ) : ( r , v ) = node . inputs if ( v . type == node . outputs [ 0 ] . type ) : return [ v ]
fill -> v this optimization is only needed in fast_compile to make the code more readable .