raiseValueError("The dimention of input, x, y should be 2 but receive input's shape: {}, x's shape: {}, y's shape: {}".format(input_shape,x_shape,y_shape))
ifinput_shape[0]!=x_shape[0]:
ifinput_shape[0]!=1:
raiseValueError("When x's dimension[0] is not equal with input's dimension[0], input's dimension[0] must be 1 but got {}".format(input_shape[0]))
ifinput_shape[1]!=y_shape[1]andinput_shape[1]!=1:
raiseValueError("When y's dimension[1] is not equal with input's dimension[1], input's dimension[1] must be 1 but got {}".format(input_shape[1]))
ifinput_shape[1]!=y_shape[1]:
ifinput_shape[1]!=1:
raiseValueError("When y's dimension[1] is not equal with input's dimension[1], input's dimension[1] must be 1 but got {}".format(input_shape[1]))
ifinput_shape[0]!=x_shape[0]andinput_shape[0]!=1:
raiseValueError("When x's dimension[0] is not equal with input's dimension[0], input's dimension[0] must be 1 but got {}".format(input_shape[0]))
ifnotlen(x_shape)==len(y_shape)==2:
raiseValueError("The dimention of x, y should be 2 but receive x's shape: {}, y's shape: {}".format(x_shape,y_shape))
ifx_shape[1]!=y_shape[0]:
raiseValueError("The input Variable x's width must be equal with Variable y' height. But received x's shape = {}, y's shape = {}.".format(x_shape,y_shape))
iflen(input_shape)==2:
ifinput_shape[0]!=x_shape[0]:
ifinput_shape[0]!=1:
raiseValueError("When x's dimension[0] is not equal with input's dimension[0], input's dimension[0] must be 1 but got {}".format(input_shape[0]))
ifinput_shape[1]!=y_shape[1]andinput_shape[1]!=1:
raiseValueError("When y's dimension[1] is not equal with input's dimension[1], input's dimension[1] must be 1 but got {}".format(input_shape[1]))
ifinput_shape[1]!=y_shape[1]:
ifinput_shape[1]!=1:
raiseValueError("When y's dimension[1] is not equal with input's dimension[1], input's dimension[1] must be 1 but got {}".format(input_shape[1]))
eliflen(input_shape)==1:
ifinput_shape[0]notin(y_shape[1],1):
raiseValueError("The input's shape: {} is not broadcastable with [x.shape[0], y.shape[1]]: [{},{}]".format(input_shape,x_shape[0],y_shape[1]))
else:
raiseValueError("The dimention of input should be 2 or 1 but receive input's shape: {}".format(input_shape))