MCPcopy Create free account
hub / github.com/pytorch/executorch / prepare_input_file

Function prepare_input_file

backends/qualcomm/export_utils.py:900–911  ·  view source on GitHub ↗
(tensor, fd, index, sub_index)

Source from the content-addressed store, hash-verified

898 input_files = []
899
900 def prepare_input_file(tensor, fd, index, sub_index):
901 # transform torch.Tensor to raw file
902 input_file_name = f"{prefix_input_filename}_input_{index}_{sub_index}.raw"
903 input_file_path = f"{dest_path}/{input_file_name}"
904 if not isinstance(tensor, torch.Tensor):
905 tensor = torch.tensor(tensor)
906 tensor.detach().numpy().tofile(input_file_path)
907 input_files.append(input_file_path)
908 # prepare input_list
909 if sub_index > 0:
910 fd.write(" ")
911 fd.write(input_file_name)
912
913 # Prepare input data
914 if inputs is not None:

Callers 1

generate_inputsFunction · 0.85

Calls 2

writeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected