original_docstring: 
          Sample elements from the replay buffer.
          Custom sampling when using memory efficient variant,
          as we should not sample the element with index `self.pos`
          See https://github.com/DLR-RM/stable-baselines3/pull/28#issuecomment-637559274
  
          :param batch_size: Number of element to sample
          :param env: associated gym VecEnv
              to normalize the observations/rewards when sampling
          :return:
          
docstring: Sample elements from the replay buffer.
docstring_tokens: Sample elements from the replay buffer .
code: def sample(self, batch_size: int, env: Optional[VecNormalize] = None) -> ReplayBufferSamples:
          """
          Sample elements from the replay buffer.
          Custom sampling when using memory efficient variant,
          as we should not sample the element with index `self.pos`
          See https://github.com/DLR-RM/stable-baselines3/pull/28#issuecomment-637559274
  
          :param batch_size: Number of element to sample
          :param env: associated gym VecEnv
              to normalize the observations/rewards when sampling
          :return:
          """
          if not self.optimize_memory_usage:
              return super().sample(batch_size=batch_size, env=env)
          # Do not sample the element with index `self.pos` as the transitions is invalid
          # (we use only one array to store `obs` and `next_obs`) 傻逼玩意连内存买不起？
          if self.full:
              batch_inds = (np.random.randint(1, self.buffer_size, size=batch_size) + self.pos) % self.buffer_size
          else:
              batch_inds = np.random.randint(0, self.pos, size=batch_size)
          return self._get_samples(batch_inds, env=env)
code_tokens: def sample ( self , batch_size : int , env : Optional [ VecNormalize ] = None ) -> ReplayBufferSamples : if not self . optimize_memory_usage : return super ( ) . sample ( batch_size = batch_size , env = env ) if self . full : batch_inds = ( np . random . randint ( 1 , self . buffer_size , size = batch_size ) + self . pos ) % self . buffer_size else : batch_inds = np . random . randint ( 0 , self . pos , size = batch_size ) return self . _get_samples ( batch_inds , env = env )
short_docstring: Sample elements from the replay buffer.
short_docstring_tokens: Sample elements from the replay buffer .
comment: """
          Sample elements from the replay buffer.
          Custom sampling when using memory efficient variant,
          as we should not sample the element with index `self.pos`
          See https://github.com/DLR-RM/stable-baselines3/pull/28#issuecomment-637559274
  
          :param batch_size: Number of element to sample
          :param env: associated gym VecEnv
              to normalize the observations/rewards when sampling
          :return:
          """$SEP$# Do not sample the element with index `self.pos` as the transitions is invalid$SEP$# (we use only one array to store `obs` and `next_obs`) 傻逼玩意连内存买不起？