-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
you can store the output shape to aviod a function calling
def __init__(self, 巴拉巴拉什么的):
self.outputshape_list = self.getOutputShapes()
self.output_num = len(outputshape_list )
def Inference(self, input, perf_profile = PerfProfile.DEFAULT, graphIndex = 0):
output = self.m_context.Inference(input, perf_profile, graphIndex)
for i in range(self.output_num):
output[i].reshape(outputshape_list[i]) # although it reshapes the outputs but numpy.reshape returns a view
return outputalthough it reshapes the outputs but numpy.reshape returns a view, not a C-continuous array, may cause so problem in downstream processing.(但其实大多数处理还是要再reshape一次,所以C不C连续都没什么问题)
so please reshape the outputs in C/C++ level, (pybind is suitable for connecting C/C++ to numpy)
Metadata
Metadata
Assignees
Labels
No labels