TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
polygraphy.comparator.data_loader.DataLoader Class Reference
Inheritance diagram for polygraphy.comparator.data_loader.DataLoader:
Collaboration diagram for polygraphy.comparator.data_loader.DataLoader:

Public Member Functions

def __init__ (self, seed=None, iterations=None, input_metadata=None, int_range=None, float_range=None)
 
def __getitem__ (self, index)
 

Public Attributes

 seed
 
 iterations
 
 user_input_metadata
 
 int_range
 
 float_range
 
 input_metadata
 

Constructor & Destructor Documentation

◆ __init__()

def polygraphy.comparator.data_loader.DataLoader.__init__ (   self,
  seed = None,
  iterations = None,
  input_metadata = None,
  int_range = None,
  float_range = None 
)
Args:
    seed (int):
    The seed to use when generating random inputs.
    Defaults to ``util.constants.DEFAULT_SEED``.
    iterations (int):
    The number of iterations for which to supply data.
    Defaults to 1.
    input_metadata (TensorMetadata):
    A mapping of input names to their corresponding shapes and data types.
    This will be used to determine what shapes to supply for inputs with dynamic shape, as
    well as to set the data type of the generated inputs.
    If either dtype or shape are None, then the value will be automatically determined.
    For input shape tensors, i.e. inputs whose *value* describes a shape in the model, the
    provided shape will be used to populate the values of the inputs, rather than to determine
    their shape.
    int_range (Tuple[int]):
    A tuple containing exactly 2 integers, indicating the minimum and maximum integer values (inclusive)
    the data loader should generate. If either value in the tuple is None, the default will be used
    for that value.
    If None is provided instead of a tuple, then the default values will be used for both the
    minimum and maximum.
    float_range (Tuple[float]):
    A tuple containing exactly 2 floats, indicating the minimum and maximum float values (inclusive)
    the data loader should generate. If either value in the tuple is None, the default will be used
    for that value.
    If None is provided instead of a tuple, then the default values will be used for both the
    minimum and maximum.

Member Function Documentation

◆ __getitem__()

def polygraphy.comparator.data_loader.DataLoader.__getitem__ (   self,
  index 
)
Randomly generates input data.

Args:
    index (int):
    Since this class behaves like an iterable, it takes an index parameter.
    Generated data is guaranteed to be the same for the same index.

    Returns:
OrderedDict[str, numpy.ndarray]: A mapping of input names to input numpy buffers.

Reimplemented from polygraphy.comparator.data_loader.BaseDataLoader.

Member Data Documentation

◆ seed

polygraphy.comparator.data_loader.DataLoader.seed

◆ iterations

polygraphy.comparator.data_loader.DataLoader.iterations

◆ user_input_metadata

polygraphy.comparator.data_loader.DataLoader.user_input_metadata

◆ int_range

polygraphy.comparator.data_loader.DataLoader.int_range

◆ float_range

polygraphy.comparator.data_loader.DataLoader.float_range

◆ input_metadata

polygraphy.comparator.data_loader.DataLoader.input_metadata

The documentation for this class was generated from the following file: