class_docstr: :class:`SeqSampler` is used to sample negative item sequence.
  
  Args:
      datasets (Dataset or list of Dataset): All the dataset for each phase.
      distribution (str, optional): Distribution of the negative items. Defaults to 'uniform'.
class_docstr_tok: [":","class",":","`","SeqSampler","`","is","used","to","sample","negative","item","sequence",".","Args",":","datasets","(","Dataset","or","list","of","Dataset",")",":","All","the","dataset","for","each","phase",".","distribution","(","str",",","optional",")",":","Distribution","of","the","negative","items",".","Defaults","to","'uniform","'","."]
docstr: For each moment, sampling one item from all the items except the one the user clicked on at that moment.
  
  Args:
      pos_sequence (torch.Tensor):  all users' item history sequence, with the shape of `(N, )`.
  
  Returns:
      torch.tensor : all users' negative item history sequence.
docstr_tok: ["For","each","moment",",","sampling","one","item","from","all","the","items","except","the","one","the","user","clicked","on","at","that","moment",".","Args",":","pos_sequence","(","torch.Tensor",")",":","all","users","'","item","history","sequence",",","with","the","shape","of","`","(","N",",",")","`",".","Returns",":","torch.tensor",":","all","users","'","negative","item","history","sequence","."]
code: def sample_neg_sequence(self, pos_sequence):
      """For each moment, sampling one item from all the items except the one the user clicked on at that moment.
  
      Args:
          pos_sequence (torch.Tensor):  all users' item history sequence, with the shape of `(N, )`.
  
      Returns:
          torch.tensor : all users' negative item history sequence.
  
      """
      total_num = len(pos_sequence)
      value_ids = np.zeros(total_num, dtype=np.int64)
      check_list = np.arange(total_num)
      while len(check_list) > 0:
          value_ids[check_list] = self.sampling(len(check_list))
          check_index = np.where(
              value_ids[check_list] == pos_sequence[check_list]
          )
          check_list = check_list[check_index]
  
      return torch.tensor(value_ids)
  
imports: import copy
  import numpy
  from numpy.random import sample
  import torch
  from collections import Counter
label_desc: Use image node_id 4 for calling the SeqSampler obj's underlying member method code with example usage: obj.sample_neg_sequence(pos_sequence) and returns: torch