AllentDan e1aabf5837
[Doc] How to write a customized TensorRT plugin (#290)
* first edition

* fix lint

* add 06, 07

* resolve comments

* update index.rst

* update title

* update img
2022-08-22 14:00:28 +08:00

2 lines
15 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<svg xmlns="http://www.w3.org/2000/svg" id="export" class="canvas" preserveAspectRatio="xMidYMid meet" style="width: 305px; height: 646px;" width="115" height="457"><rect id="background" fill="#fff" pointer-events="all" width="115" height="457"/><g id="origin" transform="translate(5.218945312500001, 5.218945312500001) scale(1)"><g id="clusters" class="clusters"/><g id="edge-paths" class="edge-paths"><defs><marker id="arrowhead-vee" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto" style="fill: rgb(0, 0, 0);"><path d="M 0 0 L 10 5 L 0 10 L 4 5 z" style="stroke-width: 1;"/></marker><marker id="arrowhead-vee-select" viewBox="0 0 10 10" refX="9" refY="5" markerUnits="strokeWidth" markerWidth="8" markerHeight="6" orient="auto" style="fill: rgb(238, 0, 0);"><path d="M 0 0 L 10 5 L 0 10 L 4 5 z" style="stroke-width: 1;"/></marker></defs><path id="edge-input" class="edge-path" d="M21.28515625,23L21.28515625,24.666666666666668C21.28515625,26.333333333333332,21.28515625,29.666666666666668,21.28515625,33C21.28515625,36.333333333333336,21.28515625,39.666666666666664,21.28515625,43C21.28515625,46.333333333333336,21.28515625,49.666666666666664,23.666757509689926,53C26.048358769379846,56.333333333333336,30.81156128875969,59.666666666666664,33.193162548449614,61.333333333333336L35.57476380813954,63" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-factor" class="edge-path" d="M82.73046875,23L82.73046875,24.666666666666668C82.73046875,26.333333333333332,82.73046875,29.666666666666668,82.73046875,33C82.73046875,36.333333333333336,82.73046875,39.666666666666664,82.73046875,43C82.73046875,46.333333333333336,82.73046875,49.666666666666664,80.34886749031007,53C77.96726623062015,56.333333333333336,73.20406371124031,59.666666666666664,70.82246245155038,61.333333333333336L68.44086119186046,63" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-8" class="edge-path" d="M52.0078125,86L52.0078125,87.66666666666667C52.0078125,89.33333333333333,52.0078125,92.66666666666667,52.0078125,96C52.0078125,99.33333333333333,52.0078125,102.66666666666667,52.0078125,104.33333333333333L52.0078125,106" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-9" class="edge-path" d="M52.0078125,163L52.0078125,164.66666666666666C52.0078125,166.33333333333334,52.0078125,169.66666666666666,52.0078125,173C52.0078125,176.33333333333334,52.0078125,179.66666666666666,52.0078125,181.33333333333334L52.0078125,183" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-10" class="edge-path" d="M52.0078125,206L52.0078125,207.66666666666666C52.0078125,209.33333333333334,52.0078125,212.66666666666666,52.0078125,216C52.0078125,219.33333333333334,52.0078125,222.66666666666666,52.0078125,224.33333333333334L52.0078125,226" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-11" class="edge-path" d="M52.0078125,283L52.0078125,284.6666666666667C52.0078125,286.3333333333333,52.0078125,289.6666666666667,52.0078125,293C52.0078125,296.3333333333333,52.0078125,299.6666666666667,52.0078125,301.3333333333333L52.0078125,303" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-12" class="edge-path" d="M52.0078125,326L52.0078125,327.6666666666667C52.0078125,329.3333333333333,52.0078125,332.6666666666667,52.0078125,336C52.0078125,339.3333333333333,52.0078125,342.6666666666667,52.0078125,344.3333333333333L52.0078125,346" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/><path id="edge-output" class="edge-path" d="M52.0078125,403L52.0078125,404.6666666666667C52.0078125,406.3333333333333,52.0078125,409.6666666666667,52.0078125,413C52.0078125,416.3333333333333,52.0078125,419.6666666666667,52.0078125,421.3333333333333L52.0078125,423" style="stroke: rgb(0, 0, 0); stroke-width: 1px; fill: none; marker-end: url(&quot;#arrowhead-vee&quot;);"/></g><g id="edge-labels" class="edge-labels"/><g id="nodes" class="nodes"><g id="input-name-input" class="node graph-input" transform="translate(1.48828125,0)" style="opacity: 1;"><g class="node-item graph-item-input" transform="translate(0,0)"><path d="M5,0h29.59375a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-29.59375a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(238, 238, 238); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision;">input</text><title>float32[batch,3,height,width]</title></g><path class="node border" d="M5,0h29.59375a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-29.59375a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="input-name-factor" class="node graph-input" transform="translate(61.08203125,0)" style="opacity: 1;"><g class="node-item graph-item-input" transform="translate(0,0)"><path d="M5,0h33.296875a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-33.296875a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(238, 238, 238); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision;">factor</text><title>float32[batch,1,height,width]</title></g><path class="node border" d="M5,0h33.296875a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-33.296875a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="node-name-DynamicTRTResize_0" class="node graph-node" transform="translate(0,63)" style="opacity: 1;"><g class="node-item node-item-type" transform="translate(0,0)"><path d="M5,0h94.015625a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-94.015625a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(0, 0, 0); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision; fill: rgb(255, 255, 255);">DynamicTRTResize</text><title>DynamicTRTResize_0</title></g><path class="node border" d="M5,0h94.015625a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-94.015625a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="node-name-Conv_1" class="node graph-node" transform="translate(10.6171875,106)" style="opacity: 1;"><g class="node-item node-item-type node-item-type-layer" transform="translate(0,0)"><path d="M5,0h72.78125a5,5 0 0 1 5,5v18a0,0 0 0 1 0,0h-82.78125a0,0 0 0 1 0,0v-18a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(51, 85, 136); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision; fill: rgb(255, 255, 255);">Conv</text><title>Conv_1</title></g><g class="node-attribute" transform="translate(0,23)"><path d="M0,0h82.78125a0,0 0 0 1 0,0v29a5,5 0 0 1 -5,5h-72.78125a5,5 0 0 1 -5,-5v-29a0,0 0 0 1 0,0z" style="stroke: rgb(0, 0, 0); fill: rgb(255, 255, 255); stroke-width: 0;"/><text id="initializer-conv1.weight" xml:space="preserve" x="6" y="14" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 9px; font-weight: normal; text-rendering: geometricprecision;"><title>float32[64,3,9,9]</title><tspan style="font-weight: bold;">W</tspan><tspan>〈64×3×9×9〉</tspan></text><text id="initializer-conv1.bias" xml:space="preserve" x="6" y="28" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 9px; font-weight: normal; text-rendering: geometricprecision;"><title>float32[64]</title><tspan style="font-weight: bold;">B</tspan><tspan>〈64〉</tspan></text><line class="node" x1="0" x2="82.78125" y1="0" y2="0" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><path class="node border" d="M5,0h72.78125a5,5 0 0 1 5,5v47a5,5 0 0 1 -5,5h-72.78125a5,5 0 0 1 -5,-5v-47a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="node-name-Relu_2" class="node graph-node" transform="translate(34.5546875,183)" style="opacity: 1;"><g class="node-item node-item-type node-item-type-activation" transform="translate(0,0)"><path d="M5,0h24.90625a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-24.90625a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(112, 41, 33); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision; fill: rgb(255, 255, 255);">Relu</text><title>Relu_2</title></g><path class="node border" d="M5,0h24.90625a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-24.90625a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="node-name-Conv_3" class="node graph-node" transform="translate(8.1953125,226)" style="opacity: 1;"><g class="node-item node-item-type node-item-type-layer" transform="translate(0,0)"><path d="M5,0h77.625a5,5 0 0 1 5,5v18a0,0 0 0 1 0,0h-87.625a0,0 0 0 1 0,0v-18a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(51, 85, 136); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision; fill: rgb(255, 255, 255);">Conv</text><title>Conv_3</title></g><g class="node-attribute" transform="translate(0,23)"><path d="M0,0h87.625a0,0 0 0 1 0,0v29a5,5 0 0 1 -5,5h-77.625a5,5 0 0 1 -5,-5v-29a0,0 0 0 1 0,0z" style="stroke: rgb(0, 0, 0); fill: rgb(255, 255, 255); stroke-width: 0;"/><text id="initializer-conv2.weight" xml:space="preserve" x="6" y="14" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 9px; font-weight: normal; text-rendering: geometricprecision;"><title>float32[32,64,1,1]</title><tspan style="font-weight: bold;">W</tspan><tspan>〈32×64×1×1〉</tspan></text><text id="initializer-conv2.bias" xml:space="preserve" x="6" y="28" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 9px; font-weight: normal; text-rendering: geometricprecision;"><title>float32[32]</title><tspan style="font-weight: bold;">B</tspan><tspan>〈32〉</tspan></text><line class="node" x1="0" x2="87.625" y1="0" y2="0" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><path class="node border" d="M5,0h77.625a5,5 0 0 1 5,5v47a5,5 0 0 1 -5,5h-77.625a5,5 0 0 1 -5,-5v-47a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="node-name-Relu_4" class="node graph-node" transform="translate(34.5546875,303)" style="opacity: 1;"><g class="node-item node-item-type node-item-type-activation" transform="translate(0,0)"><path d="M5,0h24.90625a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-24.90625a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(112, 41, 33); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision; fill: rgb(255, 255, 255);">Relu</text><title>Relu_4</title></g><path class="node border" d="M5,0h24.90625a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-24.90625a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g id="node-name-Conv_5" class="node graph-node" transform="translate(10.6171875,346)" style="opacity: 1;"><g class="node-item node-item-type node-item-type-layer" transform="translate(0,0)"><path d="M5,0h72.78125a5,5 0 0 1 5,5v18a0,0 0 0 1 0,0h-82.78125a0,0 0 0 1 0,0v-18a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(51, 85, 136); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision; fill: rgb(255, 255, 255);">Conv</text><title>Conv_5</title></g><g class="node-attribute" transform="translate(0,23)"><path d="M0,0h82.78125a0,0 0 0 1 0,0v29a5,5 0 0 1 -5,5h-72.78125a5,5 0 0 1 -5,-5v-29a0,0 0 0 1 0,0z" style="stroke: rgb(0, 0, 0); fill: rgb(255, 255, 255); stroke-width: 0;"/><text id="initializer-conv3.weight" xml:space="preserve" x="6" y="14" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 9px; font-weight: normal; text-rendering: geometricprecision;"><title>float32[3,32,5,5]</title><tspan style="font-weight: bold;">W</tspan><tspan>〈3×32×5×5〉</tspan></text><text id="initializer-conv3.bias" xml:space="preserve" x="6" y="28" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 9px; font-weight: normal; text-rendering: geometricprecision;"><title>float32[3]</title><tspan style="font-weight: bold;">B</tspan><tspan>〈3〉</tspan></text><line class="node" x1="0" x2="82.78125" y1="0" y2="0" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><path class="node border" d="M5,0h72.78125a5,5 0 0 1 5,5v47a5,5 0 0 1 -5,5h-72.78125a5,5 0 0 1 -5,-5v-47a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g><g class="node" transform="translate(28.4609375,423)" style="opacity: 1;"><g class="node-item graph-item-output" transform="translate(0,0)"><path d="M5,0h37.09375a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-37.09375a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(0, 0, 0); fill: rgb(238, 238, 238); stroke-width: 0;"/><text x="6" y="16" style="font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe WPC&quot;, &quot;Segoe UI&quot;, Ubuntu, &quot;Droid Sans&quot;, sans-serif, &quot;PingFang SC&quot;; font-size: 11px; text-rendering: geometricprecision;">output</text><title>float32[batch,3,height,width]</title></g><path class="node border" d="M5,0h37.09375a5,5 0 0 1 5,5v13a5,5 0 0 1 -5,5h-37.09375a5,5 0 0 1 -5,-5v-13a5,5 0 0 1 5,-5z" style="stroke: rgb(51, 51, 51); fill: none; stroke-width: 1px;"/></g></g></g></svg>