#NEWLINE# def from_onehot( x_var ) : #NEWLINE# #INDENT# ret = np . zeros ( ( len ( x_var ) , ) , 'int32' ) #NEWLINE# ( nonzero_n , nonzero_a ) = np . nonzero ( x_var ) #NEWLINE# ret [ nonzero_n ] = nonzero_a #NEWLINE# return ret