Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aidge_export_tensorrt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nathan Thoumine
aidge_export_tensorrt
Commits
e6c1c7fb
Commit
e6c1c7fb
authored
1 year ago
by
Nathan Thoumine
Browse files
Options
Downloads
Patches
Plain Diff
add docstring for user functions
parent
41161cd8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aidge_export_tensorrt/static/tensorrt_8.6/python_binding/pybind_export.cpp
+73
-9
73 additions, 9 deletions
...orrt/static/tensorrt_8.6/python_binding/pybind_export.cpp
with
73 additions
and
9 deletions
aidge_export_tensorrt/static/tensorrt_8.6/python_binding/pybind_export.cpp
+
73
−
9
View file @
e6c1c7fb
...
...
@@ -21,14 +21,69 @@ void init_Graph(py::module& m)
.
def
(
py
::
init
<
std
::
string
,
unsigned
int
,
int
>
(),
py
::
arg
(
"filepath"
)
=
""
,
py
::
arg
(
"device_id"
)
=
0
,
py
::
arg
(
"nb_bits"
)
=
-
32
)
py
::
arg
(
"nb_bits"
)
=
-
32
,
R"mydelimiter(
Construct a new Graph object.
:param filepath: Path to the file to load (default is empty).
:type filepath: str
:param device_id: Device ID to use (default is 0).
:type device_id: unsigned int
:param nb_bits: Number of bits for data (default is -32).
:type nb_bits: int
)mydelimiter"
)
.
def
(
"device"
,
&
Graph
::
device
,
py
::
arg
(
"id"
))
.
def
(
"load"
,
&
Graph
::
load
,
py
::
arg
(
"filepath"
))
.
def
(
"save"
,
&
Graph
::
save
,
py
::
arg
(
"filepath"
))
.
def
(
"calibrate"
,
&
Graph
::
calibrate
,
py
::
arg
(
"calibration_folder_path"
)
=
"./calibration_folder/"
,
py
::
arg
(
"cache_file_path"
)
=
"./calibration_cache"
,
py
::
arg
(
"batch_size"
)
=
1
)
.
def
(
"initialize"
,
&
Graph
::
initialize
)
.
def
(
"profile"
,
&
Graph
::
profile
,
py
::
arg
(
"nb_iterations"
),
py
::
arg
(
"mode"
)
=
ExecutionMode_T
::
ASYNC
)
.
def
(
"device"
,
&
Graph
::
device
,
py
::
arg
(
"id"
),
R"mydelimiter(
Set the CUDA device.
:param id: Device ID.
:type id: unsigned int
)mydelimiter"
)
.
def
(
"load"
,
&
Graph
::
load
,
py
::
arg
(
"filepath"
),
R"mydelimiter(
Load graph from a file.
:param filepath: Path to the file.
:type filepath: str
)mydelimiter"
)
.
def
(
"save"
,
&
Graph
::
save
,
py
::
arg
(
"filepath"
),
R"mydelimiter(
Save graph to a file.
:param filepath: Path to the file.
:type filepath: str
)mydelimiter"
)
.
def
(
"calibrate"
,
&
Graph
::
calibrate
,
py
::
arg
(
"calibration_folder_path"
)
=
"./calibration_folder/"
,
py
::
arg
(
"cache_file_path"
)
=
"./calibration_cache"
,
py
::
arg
(
"batch_size"
)
=
1
,
R"mydelimiter(
Calibrate the graph using the calibration data found inside the `calibration` folder.
:param calibration_folder_path: Path to the calibration folder.
:type calibration_folder_path: str
:param cache_file_path: Path to the cache file.
:type cache_file_path: str
:param batch_size: Batch size for calibration (default is 1).
:type batch_size: int
)mydelimiter"
)
.
def
(
"initialize"
,
&
Graph
::
initialize
,
R"mydelimiter(
Initialize the graph.
)mydelimiter"
)
.
def
(
"profile"
,
&
Graph
::
profile
,
py
::
arg
(
"nb_iterations"
),
py
::
arg
(
"mode"
)
=
ExecutionMode_T
::
ASYNC
,
R"mydelimiter(
Profile the graph's execution by printing the average profiled TensorRT process time per stimulus.
:param nb_iterations: Number of iterations for profiling.
:type nb_iterations: unsigned int
:param mode: Execution mode (SYNC or ASYNC, default is ASYNC).
:type mode: ExecutionMode_T
)mydelimiter"
)
.
def
(
"run_sync"
,
[](
Graph
&
graph
,
py
::
list
inputs
)
->
py
::
list
{
py
::
list
outputs
;
std
::
vector
<
void
*>
bufferIn
;
...
...
@@ -65,8 +120,17 @@ void init_Graph(py::module& m)
outputs
.
append
(
processed_array
);
}
return
outputs
;
},
py
::
arg
(
"inputs"
))
;
},
py
::
arg
(
"inputs"
),
R"mydelimiter(
Run the graph.
:param inputs: Input data.
:type inputs: list
:param outputs: Output data.
:type outputs: list
:param mode: Execution mode (SYNC or ASYNC, default is ASYNC).
:type mode: ExecutionMode_T
)mydelimiter"
);
}
PYBIND11_MODULE
(
aidge_trt
,
m
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment