MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / get_inputs

Function get_inputs

samples/python/engine_refit_onnx_bidaf/data_processing.py:49–62  ·  view source on GitHub ↗
(context, query)

Source from the content-addressed store, hash-verified

47
48
49def get_inputs(context, query):
50 cw, cc = preprocess(context)
51 qw, qc = preprocess(query)
52
53 context_word_func = get_map_func("CategoryMapper_4.json")
54 context_char_func = get_map_func("CategoryMapper_5.json")
55 query_word_func = get_map_func("CategoryMapper_6.json")
56 query_char_func = get_map_func("CategoryMapper_7.json")
57
58 cw_input = context_word_func(cw).astype(trt.nptype(trt.int32)).ravel()
59 cc_input = context_char_func(cc).astype(trt.nptype(trt.int32)).ravel()
60 qw_input = query_word_func(qw).astype(trt.nptype(trt.int32)).ravel()
61 qc_input = query_char_func(qc).astype(trt.nptype(trt.int32)).ravel()
62 return cw_input, cc_input, qw_input, qc_input

Callers 2

mainFunction · 0.90
load_test_caseFunction · 0.90

Calls 2

preprocessFunction · 0.85
get_map_funcFunction · 0.85

Tested by

no test coverage detected