def get_parameter_device(module): return next(module.parameters()).device def get_parameter_dtype(module): return next(module.parameters()).dtype