-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(//cpp/api/ptq): Move from direct use of dataloader to a
buffered version to improve stability Signed-off-by: Naren Dasan <naren@narendasan.com> Signed-off-by: Naren Dasan <narens@nvidia.com>
- Loading branch information
1 parent
e6f598f
commit 4741246
Showing
3 changed files
with
43 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "torch/torch.h" | ||
#include "trtorch/ptq.h" | ||
|
||
namespace trtorch { | ||
namespace ptq { | ||
|
||
bool get_batch_impl(void* bindings[], const char* names[], int nbBindings, torch::Tensor& data) { | ||
for (int i = 0; i < nbBindings; i++) { | ||
data = data.to(at::kCUDA).contiguous(); | ||
bindings[i] = data.data_ptr(); | ||
} | ||
return true; | ||
} | ||
|
||
} // namespace ptq | ||
} // namespace trtorch |