@register_useless
@register_canonicalize
@register_specialize
@gof.local_optimizer([T.Split])
def local_useless_split(node):
 if isinstance(node.op, T.Split):
  if (node.op.len_splits == 1):
   (x, axis, splits) = node.inputs
   out = assert_op(x, T.eq(splits.shape[0], 1))
   copy_stack_trace(node.outputs, out)
   out2 = assert_op(out, T.eq(x.shape[axis], splits[0]))
   copy_stack_trace(out, out2)
   return [out2]

@ register_useless @ register_canonicalize @ register_specialize @ gof . local_optimizer ( [ T . Split ] ) def local_useless_split ( node ) : if isinstance ( node . op , T . Split ) : if ( node . op . len_splits == 1 ) : ( x , axis , splits ) = node . inputs out = assert_op ( x , T . eq ( splits . shape [ 0 ] , 1 ) ) copy_stack_trace ( node . outputs , out ) out2 = assert_op ( out , T . eq ( x . shape [ axis ] , splits [ 0 ] ) ) copy_stack_trace ( out , out2 ) return [ out2 ]
split{n_splits=1} -> x remove split with only 1 split .