| Caffe2 wrapper functions for protobuf’s
| GetEmptyStringAlreadyInited() function used to
| avoid duplicated global variable in the case
| when protobuf is built with hidden visibility.
| Given a net, modify the external inputs/outputs
| if necessary so that the following conditions
| are met
|
| - No duplicate external inputs
|
| - No duplicate external outputs
|
| - Going through list of ops in order,
| all op inputs must be outputs from other
| ops, or registered as external inputs.
|
| - All external outputs must be outputs
| of some operators.
|
| A simplified version compared to the
| full
|
| CreateOperator, if you do not need to
| specify args.
|
| IterableInputs default = std::initializer_list
|
| IterableOutputs default = std::initializer_list
|
| IterableInputs default = std::initializer_list
|
| IterableOutputs default = std::initializer_list
|
| IterableArgs default = std::initializer_list
|| A wrapper function to return device
| name string for use in blob serialization
| / deserialization.
|
| This should have one to one correspondence
| with caffe2/proto/caffe2.proto:
| enum DeviceType.
|
| ———–
| @note
|
| we can’t use DeviceType_Name, because
| that is only available in protobuf-full,
| and some platforms (like mobile) may
| want to use protobuf-lite instead.
|
| Helper methods to get an argument from
| OperatorDef or NetDef given argument
| name. Throws if argument does not exist.
|
| Return the argument index or -1 if it
| does not exist.
|
| Helper methods to get an argument from
| OperatorDef or NetDef given argument
| name. Returns nullptr if argument does not
| exist.
| Helper methods to query a boolean argument
| flag from OperatorDef or NetDef given
| argument name. If argument does not
| exist, return default value.
|
| Throws if argument exists but the type
| is not boolean.
|
| Returns if the two DeviceOptions are
| pointing to the same device.
|
| ONNX wrapper functions for protobuf’s
| GetEmptyStringAlreadyInited() function used to
| avoid duplicated global variable in the case
| when protobuf is built with hidden visibility.
| Read Proto from a file, letting the code
| figure out if it is text or binary.
|
| Common interfaces that are supported
| by both lite and full protobuf.
|
| Common interfaces that reads file contents
| into a string.
|
| A wrapper function to shut down protobuf
| library (this is needed in ASAN testing and
| valgrind cases to avoid protobuf appearing to
| “leak” memory).
| Helper function to verify that conversion
| between types won’t loose any significant
| bit.
|