Skip to content

Commit

Permalink
Cleanup shape inference implementation (#5596)
Browse files Browse the repository at this point in the history
### Description

* Change the handling of undefined operators (to produce an error
message).
* Stop special treatment of experimental ops.
* [Both of above are very old special handling. Recommend removing this,
unless we find a compelling reason to maintain compatibility.]
* Cleanup the use of an unnecessary GraphProto object to act as
container for inferred types.
* Move methods (BindValuesOnCall/Return) that do not need to be class
methods into functions
* Change method names to comply with naming convention.

### Motivation and Context

* General cleanup
* Also prepare this for feature extensions, like incremental inference
for use by inliner.

---------

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
  • Loading branch information
gramalingam and justinchuby committed Oct 5, 2023
1 parent 9c452f9 commit 2caeb6a
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 131 deletions.
19 changes: 19 additions & 0 deletions onnx/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,22 @@
#define ONNX_CATCH(x) catch (x)
#define ONNX_HANDLE_EXCEPTION(func) func()
#endif

// Macros to disable the copy and/or assignment methods
// These are usually placed in the private: declarations for a class.

#define ONNX_DISALLOW_COPY(TypeName) TypeName(const TypeName&) = delete

#define ONNX_DISALLOW_ASSIGNMENT(TypeName) TypeName& operator=(const TypeName&) = delete

#define ONNX_DISALLOW_COPY_AND_ASSIGNMENT(TypeName) \
ONNX_DISALLOW_COPY(TypeName); \
ONNX_DISALLOW_ASSIGNMENT(TypeName)

#define ONNX_DISALLOW_MOVE(TypeName) \
TypeName(TypeName&&) = delete; \
TypeName& operator=(TypeName&&) = delete

#define ONNX_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(TypeName) \
ONNX_DISALLOW_COPY_AND_ASSIGNMENT(TypeName); \
ONNX_DISALLOW_MOVE(TypeName)

0 comments on commit 2caeb6a

Please sign in to comment.