File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,15 @@ def config_from_pytorch_model(
292292 Users are advised to inspect the returned object to tweak the conversion configuration.
293293 The return object can be passed as `hls_config` parameter to `convert_from_pytorch_model`.
294294
295+ Note that hls4ml internally follows the keras convention for nested tensors known as
296+ "channels last", wherease pytorch uses the "channels first" convention.
297+ For exampe, for a tensor encoding an image with 3 channels, pytorch will expect the data
298+ to be encoded as (Number_Of_Channels, Height , Width), whereas hls4ml expects
299+ (Height , Width, Number_Of_Channels). By default, hls4ml will perform the necessary
300+ conversions of the inputs and internal tensors automatically, but will return the output
301+ in "channels last" However, this behavior can be controlled by the user using the
302+ related arguments discussed below.
303+
295304 Args:
296305 model: PyTorch model
297306 input_shape (tuple or list of tuples): The shape of the input tensor, excluding the batch size.
You can’t perform that action at this time.
0 commit comments