def _stride(stride_spec):
 if (stride_spec is None):
  return [1, 1, 1, 1]
 elif isinstance(stride_spec, int):
  return [1, stride_spec, stride_spec, 1]
 elif (len(stride_spec) == 1):
  return [1, stride_spec[0], stride_spec[0], 1]
 elif (len(stride_spec) == 2):
  return [1, stride_spec[0], stride_spec[1], 1]
 else:
  assert (len(stride_spec) == 4)
  return stride_spec

def _stride ( stride_spec ) : if ( stride_spec is None ) : return [ 1 , 1 , 1 , 1 ] elif isinstance ( stride_spec , int ) : return [ 1 , stride_spec , stride_spec , 1 ] elif ( len ( stride_spec ) == 1 ) : return [ 1 , stride_spec [ 0 ] , stride_spec [ 0 ] , 1 ] elif ( len ( stride_spec ) == 2 ) : return [ 1 , stride_spec [ 0 ] , stride_spec [ 1 ] , 1 ] else : assert ( len ( stride_spec ) == 4 ) return stride_spec
expands the stride spec into a length 4 list .