| 1678 | } |
| 1679 | |
| 1680 | bool Bindings::setSafeTensorAddresses(nvinfer1::safe::IExecutionContext& context) const |
| 1681 | { |
| 1682 | for (auto const& b : mNames) |
| 1683 | { |
| 1684 | auto const name = b.first.c_str(); |
| 1685 | if (context.getEngine().getTensorIOMode(name) == nvinfer1::TensorIOMode::kINPUT) |
| 1686 | { |
| 1687 | if (!context.setInputTensorAddress(name, static_cast<void const*>(mDevicePointers[b.second]))) |
| 1688 | { |
| 1689 | return false; |
| 1690 | } |
| 1691 | } |
| 1692 | else |
| 1693 | { |
| 1694 | if (!context.setOutputTensorAddress(name, mDevicePointers[b.second])) |
| 1695 | { |
| 1696 | return false; |
| 1697 | } |
| 1698 | } |
| 1699 | } |
| 1700 | return true; |
| 1701 | } |
| 1702 | |
| 1703 | } // namespace sample |
no test coverage detected