#NEWLINE# def make_node( self , x , b , y_idx ) : #NEWLINE# #INDENT# x = tensor . as_tensor_variable ( x ) #NEWLINE# b = tensor . as_tensor_variable ( b ) #NEWLINE# y_idx = tensor . as_tensor_variable ( y_idx ) #NEWLINE# if ( ( x . type . ndim != 2 ) or ( x . type . dtype not in tensor . float_dtypes ) ) : #NEWLINE# #INDENT# raise ValueError ( 'x must be 2-d tensor of floats' , x . type ) #NEWLINE# #UNINDENT# if ( ( b . type . ndim != 1 ) or ( x . type . dtype not in tensor . float_dtypes ) ) : #NEWLINE# #INDENT# raise ValueError ( 'b must be 1-d tensor of floats' , b . type ) #NEWLINE# #UNINDENT# if ( ( y_idx . type . ndim != 1 ) or ( y_idx . type . dtype not in tensor . discrete_dtypes ) ) : #NEWLINE# #INDENT# raise ValueError ( 'y_idx must be 1-d tensor of [u]ints' , y_idx . type ) #NEWLINE# #UNINDENT# nll = tensor . TensorType ( x . type . dtype , y_idx . type . broadcastable ) . make_variable ( ) #NEWLINE# sm = x . type ( ) #NEWLINE# am = y_idx . type ( ) #NEWLINE# return Apply ( self , [ x , b , y_idx ] , [ nll , sm , am ] )