@register_canonicalize('local_incsubtensor_of_allocs')
@register_stabilize('local_incsubtensor_of_allocs')
@gof.local_optimizer([IncSubtensor, AdvancedIncSubtensor, AdvancedIncSubtensor1])
def local_incsubtensor_of_zeros(node):
 if (isinstance(node.op, (IncSubtensor, AdvancedIncSubtensor, AdvancedIncSubtensor1)) and (not node.op.set_instead_of_inc)):
  x = node.inputs[0]
  y = node.inputs[1]
  try:
   if (get_scalar_constant_value(y, elemwise=False) == 0):
    return [x]
  except NotScalarConstantError:
   return

@ register_canonicalize ( 'local_incsubtensor_of_allocs' ) @ register_stabilize ( 'local_incsubtensor_of_allocs' ) @ gof . local_optimizer ( [ IncSubtensor , AdvancedIncSubtensor , AdvancedIncSubtensor1 ] ) def local_incsubtensor_of_zeros ( node ) : if ( isinstance ( node . op , ( IncSubtensor , AdvancedIncSubtensor , AdvancedIncSubtensor1 ) ) and ( not node . op . set_instead_of_inc ) ) : x = node . inputs [ 0 ] y = node . inputs [ 1 ] try : if ( get_scalar_constant_value ( y , elemwise = False ) == 0 ) : return [ x ] except NotScalarConstantError : return
incsubtensor -> x .