Skip to content

Commit

Permalink
Workaround with L0_trt_reformat_free
Browse files Browse the repository at this point in the history
  • Loading branch information
yinggeh committed Aug 2, 2024
1 parent a9a2c1c commit 2b34379
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/python/library/tritonclient/grpc/_infer_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def set_shape(self, shape):
"""
self._input.ClearField("shape")
self._input.shape.extend(shape)
self.validate_data()
return self

def set_data_from_numpy(self, input_tensor):
Expand Down
3 changes: 1 addition & 2 deletions src/python/library/tritonclient/grpc/_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -96,7 +96,6 @@ def _get_inference_request(
if request_id != "":
request.id = request_id
for infer_input in inputs:
infer_input.validate_data()
request.inputs.extend([infer_input._get_tensor()])
if infer_input._get_content() is not None:
request.raw_input_contents.extend([infer_input._get_content()])
Expand Down
1 change: 1 addition & 0 deletions src/python/library/tritonclient/http/_infer_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def set_shape(self, shape):
The updated input
"""
self._shape = shape
self.validate_data()
return self

def set_data_from_numpy(self, input_tensor, binary_data=True):
Expand Down
8 changes: 2 additions & 6 deletions src/python/library/tritonclient/http/_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -106,11 +106,7 @@ def _get_inference_request(
if timeout is not None:
parameters["timeout"] = timeout

infer_request["inputs"] = []
for infer_input in inputs:
infer_input.validate_data()
infer_request["inputs"].append(infer_input._get_tensor())

infer_request["inputs"] = [this_input._get_tensor() for this_input in inputs]
if outputs:
infer_request["outputs"] = [
this_output._get_tensor() for this_output in outputs
Expand Down

0 comments on commit 2b34379

Please sign in to comment.