def dot_shape(x, y):
 if isinstance(x, LinearTransform):
  return dot_shape_from_shape(x, tuple(y.shape))
 elif isinstance(y, LinearTransform):
  return dot_shape_from_shape(tuple(x.shape), y)
 else:
  raise TypeError('One of x or y should be a LinearTransform')

def dot_shape ( x , y ) : if isinstance ( x , LinearTransform ) : return dot_shape_from_shape ( x , tuple ( y . shape ) ) elif isinstance ( y , LinearTransform ) : return dot_shape_from_shape ( tuple ( x . shape ) , y ) else : raise TypeError ( 'One of x or y should be a LinearTransform' )
return the linear transformation of y by x or x by y when one or both of x and y is a lineartransform instance parameters x : writeme y : writeme returns writeme .