@gof.local_optimizer([T.AllocEmpty])
def local_alloc_empty_to_zeros(node):
 if isinstance(node.op, T.AllocEmpty):
  return [T.zeros(node.inputs, dtype=node.outputs[0].dtype)]

@ gof . local_optimizer ( [ T . AllocEmpty ] ) def local_alloc_empty_to_zeros ( node ) : if isinstance ( node . op , T . AllocEmpty ) : return [ T . zeros ( node . inputs , dtype = node . outputs [ 0 ] . dtype ) ]
this convert allocempty to alloc of 0 .