yamle.utils.tracing_utils module#
- yamle.utils.tracing_utils.forward_shape_hook(module, input, output)[source]#
This function is used to cache the input and output shapes of a module.
The shapes will be stored in the module as MODULE_INPUT_SHAPE_KEY and MODULE_OUTPUT_SHAPE_KEY.
- yamle.utils.tracing_utils.get_sample_input_and_target(method, batch_size=None)[source]#
This method is used to get the sample input and target of the model.
- Return type:
Tuple[Tensor,Tensor]
- yamle.utils.tracing_utils.get_input_shape_from_model(model)[source]#
This method is used to get the input shape of the model.
- Return type:
Tuple[int,...]
- yamle.utils.tracing_utils.get_output_shape_from_model(model)[source]#
This method is used to get the output shape of the model.
- Return type:
Tuple[int,...]