Skip to content

Commit

Permalink
better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyShuai committed Nov 18, 2023
1 parent 1cad975 commit 084076a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/onnxruntime/core/session/onnxruntime_lite_custom_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ OrtLiteCustomOp inherits from OrtCustomOp to bridge tween a custom func/struct a
The lifetime of an OrtLiteCustomOp instance is managed by customer code, not ort, so:
1. DO NOT cast OrtLiteCustomOp to OrtCustomOp and release since there is no virtual destructor in the hierachy.

Check notice on line 406 in include/onnxruntime/core/session/onnxruntime_lite_custom_op.h

View workflow job for this annotation

GitHub Actions / misspell

[misspell] include/onnxruntime/core/session/onnxruntime_lite_custom_op.h#L406

"hierachy" is a misspelling of "hierarchy"
Raw output
./include/onnxruntime/core/session/onnxruntime_lite_custom_op.h:406:102: "hierachy" is a misspelling of "hierarchy"
2. OrtLiteCustomFunc and OrtLiteCustomStruct, as two sub-structs, can be released in form of OrtLiteCustomOp since all members are kept in the OrtLiteCustomOp,
memory could still be recycled properly.
Finally, OrtCustomOp is a c struct bearing no v-table, so offspring structs are by design to be of zero virtual functions to maintain cast safety.
hence memory could still be recycled properly.
Further, OrtCustomOp is a c struct bearing no v-table, so offspring structs are by design to be of zero virtual functions to maintain cast safety.
*/
struct OrtLiteCustomOp : public OrtCustomOp {
using ConstOptionalFloatTensor = std::optional<const Custom::Tensor<float>&>;
Expand Down

0 comments on commit 084076a

Please sign in to comment.