MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / check_dims

Method check_dims

demo/Diffusion/models.py:170–177  ·  view source on GitHub ↗
(self, batch_size, image_height, image_width)

Source from the content-addressed store, hash-verified

168 return onnx_opt_graph
169
170 def check_dims(self, batch_size, image_height, image_width):
171 assert batch_size >= self.min_batch and batch_size <= self.max_batch
172 assert image_height % 8 == 0 or image_width % 8 == 0
173 latent_height = image_height // 8
174 latent_width = image_width // 8
175 assert latent_height >= self.min_latent_shape and latent_height <= self.max_latent_shape
176 assert latent_width >= self.min_latent_shape and latent_width <= self.max_latent_shape
177 return (latent_height, latent_width)
178
179 def get_minmax_dims(self, batch_size, image_height, image_width, static_batch, static_shape):
180 min_batch = batch_size if static_batch else self.min_batch

Callers 12

get_input_profileMethod · 0.80
get_shape_dictMethod · 0.80
get_sample_inputMethod · 0.80
get_input_profileMethod · 0.80
get_shape_dictMethod · 0.80
get_sample_inputMethod · 0.80
get_input_profileMethod · 0.80
get_shape_dictMethod · 0.80
get_sample_inputMethod · 0.80
get_input_profileMethod · 0.80
get_shape_dictMethod · 0.80
get_sample_inputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected