(tensor, fd, index, sub_index)
| 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: |
no test coverage detected