(data_tensor, mask)
return indices
Converts the one hot tensor to indices
        
        :param data_tensor: input/output tensor of shape [batch_size, n_steps, vector_size], in which the first
        dimension should actually be 1 since the code doesn't work otherwise
        :param mask: tensor the same shape of data_tensor, used to mask unimportant output steps
        :return: list of one_hot indices for the max values of data_tensor, after masking
Converts the one hot tensor to indices
        
        :param data_tensor: input/output tensor of shape [batch_size, n_steps, vector_size], in which the first
        dimension should actually be 1 since the code doesn't work otherwise
        :param mask: tensor the same shape of data_tensor, used to mask unimportant output steps
        :return: list of one_hot indices for the max values of data_tensor, after masking
Converts the one hot tensor to indices : param data_tensor : input / output tensor of shape [ batch_size n_steps vector_size ] in which the first dimension should actually be 1 since the code doesn t work otherwise : param mask : tensor the same shape of data_tensor used to mask unimportant output steps : return : list of one_hot indices for the max values of data_tensor after masking
def tensor_to_indices(data_tensor, mask):
        """
        Converts the one hot tensor to indices
        
        :param data_tensor: input/output tensor of shape [batch_size, n_steps, vector_size], in which the first
        dimension should actually be 1 since the code doesn't work otherwise
        :param mask: tensor the same shape of data_tensor, used to mask unimportant output steps
        :return: list of one_hot indices for the max values of data_tensor, after masking
        """
        assert len(data_tensor.shape) == 3 and data_tensor.shape[0] == mask.shape[0]
        locations = np.unique(np.nonzero(data_tensor * mask)[1])
        indices = np.argmax(data_tensor[0, locations, :], axis=1)
        return indices
def tensor_to_indices ( data_tensor , mask ) : assert len ( data_tensor . shape ) == 3 and data_tensor . shape [ 0 ] == mask . shape [ 0 ] locations = np . unique ( np . nonzero ( data_tensor * mask ) [ 1 ] ) indices = np . argmax ( data_tensor [ 0 , locations , : ] , axis = 1 ) return indices