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
tests.utils Namespace Reference

Functions

def quantize_by_range (x, num_bits)
 
def quantize_by_range_fused (x_tuple, num_bits)
 
def copy_state_and_quantize (dst, src, num_bits)
 
def copy_state_and_quantize_fused (dst, src, num_bits)
 
def compare (a, b, rtol=1e-7, atol=1e-6, ctol=1e-6)
 
def assert_min_mse (a, b, tol=1e-20)
 
def quant_np (x, amax, num_bits=8, fake=False, narrow_range=True)
 

Function Documentation

◆ quantize_by_range()

def tests.utils.quantize_by_range (   x,
  num_bits 
)
Quantize torch tensor by range to num_bits with symmetric zero-mean quantizer.
Here is the caller graph for this function:

◆ quantize_by_range_fused()

def tests.utils.quantize_by_range_fused (   x_tuple,
  num_bits 
)
Quantize multiple torch tensors by combined range to num_bits with symmetric zero-mean quantizer.

◆ copy_state_and_quantize()

def tests.utils.copy_state_and_quantize (   dst,
  src,
  num_bits 
)
Copy src to dst, quantize all 'weight' entries to num_bits.
Here is the call graph for this function:

◆ copy_state_and_quantize_fused()

def tests.utils.copy_state_and_quantize_fused (   dst,
  src,
  num_bits 
)
Copy src to dst, quantize all 'weight' entries to num_bits using the aggregate amax.

◆ compare()

def tests.utils.compare (   a,
  b,
  rtol = 1e-7,
  atol = 1e-6,
  ctol = 1e-6 
)
Compare two tensors and raise AssertionError if their difference is outside of tolerance.

◆ assert_min_mse()

def tests.utils.assert_min_mse (   a,
  b,
  tol = 1e-20 
)
Assert that the mean squared error between a and b is at least tol.

◆ quant_np()

def tests.utils.quant_np (   x,
  amax,
  num_bits = 8,
  fake = False,
  narrow_range = True 
)
Quantize x using numpy.