docstr: Roughly equivalent to
  
  ```
  for item in loader:
      yield infer(item, **params)
  ```
  
          Arguments:
              loader (`torch.utils.data.DataLoader` or any iterator):
                  The iterator that will be used to apply `infer` on.
              infer (any function):
                  The function to apply of each element of `loader`.
              params (`dict`):
                  The parameters passed to `infer` along with every item
              loader_batch_size (`int`, *optional*):
                  If specified, the items of `loader` are supposed to come as batch, and are loader_batched here
                  making it roughly behave as
  
  
  ```
  for items in loader:
      for i in loader_batch_size:
          item = items[i]
          yield infer(item, **params)
  ```
docstr_tok: ["Roughly","equivalent","to","``","`","for","item","in","loader",":","yield","infer","(","item",",","*","*","params",")","``","`","Arguments",":","loader","(","`","torch.utils.data.DataLoader","`","or","any","iterator",")",":","The","iterator","that","will","be","used","to","apply","`","infer","`","on",".","infer","(","any","function",")",":","The","function","to","apply","of","each","element","of","`","loader","`",".","params","(","`","dict","`",")",":","The","parameters","passed","to","`","infer","`","along","with","every","item","loader_batch_size","(","`","int","`",",","*","optional","*",")",":","If","specified",",","the","items","of","`","loader","`","are","supposed","to","come","as","batch",",","and","are","loader_batched","here","making","it","roughly","behave","as","``","`","for","items","in","loader",":","for","i","in","loader_batch_size",":","item","=","items","[","i","]","yield","infer","(","item",",","*","*","params",")","``","`"]
code: def __init__(self, loader, infer, params, loader_batch_size=None):
      """
      Roughly equivalent to
  
      ```
      for item in loader:
          yield infer(item, **params)
      ```
  
              Arguments:
                  loader (`torch.utils.data.DataLoader` or any iterator):
                      The iterator that will be used to apply `infer` on.
                  infer (any function):
                      The function to apply of each element of `loader`.
                  params (`dict`):
                      The parameters passed to `infer` along with every item
                  loader_batch_size (`int`, *optional*):
                      If specified, the items of `loader` are supposed to come as batch, and are loader_batched here
                      making it roughly behave as
  
  
      ```
      for items in loader:
          for i in loader_batch_size:
              item = items[i]
              yield infer(item, **params)
      ```"""
      self.loader = loader
      self.infer = infer
      self.params = params
      if loader_batch_size == 1:
          # Let's spare some time by deactivating altogether
          loader_batch_size = None
      self.loader_batch_size = loader_batch_size
  
      # Internal bookkeeping
      self._loader_batch_index = None
      self._loader_batch_data = None
  
imports: import numpy
  import torch
  from torch.utils.data import Dataset, IterableDataset
  from ..utils.generic import ModelOutput
label_desc: Use image node_id 1 to create a new PipelineIterator object from inherited base classes: IterableDataset with example: obj = PipelineIterator(loader, infer, params, loader_batch_size)