Allocate binding buffers for trt based on provided types and shapes dict
(types_dict, shapes_dict)
| 57 | return user_input |
| 58 | |
| 59 | def allocate_binding_buffer(types_dict, shapes_dict): |
| 60 | ''' |
| 61 | Allocate binding buffers for trt based on provided types and shapes dict |
| 62 | ''' |
| 63 | return { |
| 64 | k: torch.zeros(reduce(lambda v, a: v*a, shape), dtype=types_dict[k]).cuda() |
| 65 | for k, shape in shapes_dict.items() |
| 66 | } |
| 67 | |
| 68 | |
| 69 | def set_kv_data(kv_dict, past_or_present, layer_id, segment_value_dict): |
no test coverage detected