(self)
return mask, var_to_domsize
generate_var_mask returns a mask tensor where invalid domain indexes
        for a given variable/VID has value -10e6.

        An invalid domain index is possible since domain indexes are expanded
        to the maximum domain size of a given VID: e.g. if a variable A has
        10 unique values and variable B has 6 unique values, then the last
        4 domain indexes (index 6-9) of variable B are invalid.

        :return: Torch.Tensor of size (# of variables) X (max domain)
            where tensor[i][j] = 0 iff the value corresponding to domain index 'j'
            is valid for the i-th VID and tensor[i][j] = -10e6 otherwise.
generate_var_mask returns a mask tensor where invalid domain indexes
        for a given variable/VID has value -10e6.
generate_var_mask returns a mask tensor where invalid domain indexes for a given variable / VID has value - 10e6 .
def generate_var_mask(self):
        """
        generate_var_mask returns a mask tensor where invalid domain indexes
        for a given variable/VID has value -10e6.

        An invalid domain index is possible since domain indexes are expanded
        to the maximum domain size of a given VID: e.g. if a variable A has
        10 unique values and variable B has 6 unique values, then the last
        4 domain indexes (index 6-9) of variable B are invalid.

        :return: Torch.Tensor of size (# of variables) X (max domain)
            where tensor[i][j] = 0 iff the value corresponding to domain index 'j'
            is valid for the i-th VID and tensor[i][j] = -10e6 otherwise.
        """
        var_to_domsize = {}
        query = 'SELECT _vid_, domain_size FROM %s' % AuxTables.cell_domain.name
        res = self.ds.engine.execute_query(query)
        mask = torch.zeros(self.total_vars,self.classes)
        for tuple in tqdm(res):
            vid = int(tuple[0])
            max_class = int(tuple[1])
            mask[vid, max_class:] = -10e6
            var_to_domsize[vid] = max_class
        return mask, var_to_domsize
def generate_var_mask ( self ) : var_to_domsize = { } query = 'SELECT _vid_, domain_size FROM %s' % AuxTables . cell_domain . name res = self . ds . engine . execute_query ( query ) mask = torch . zeros ( self . total_vars , self . classes ) for tuple in tqdm ( res ) : vid = int ( tuple [ 0 ] ) max_class = int ( tuple [ 1 ] ) mask [ vid , max_class : ] = - 10e6 var_to_domsize [ vid ] = max_class return mask , var_to_domsize