pub struct ApiDef {
Show 13 fields pub graph_op_name: String, pub deprecation_message: String, pub deprecation_version: i32, pub visibility: i32, pub endpoint: Vec<Endpoint>, pub in_arg: Vec<Arg>, pub out_arg: Vec<Arg>, pub arg_order: Vec<String>, pub attr: Vec<Attr>, pub summary: String, pub description: String, pub description_prefix: String, pub description_suffix: String,
}
Expand description

Used to specify and override the default API & behavior in the generated code for client languages, from what you would get from the OpDef alone. There will be a set of ApiDefs that are common to all client languages, and another set per client language. The per-client-language ApiDefs will inherit values from the common ApiDefs which it can either replace or modify.

We separate the API definition from the OpDef so we can evolve the API while remaining backwards compatible when interpreting old graphs. Overrides go in an “api_def.pbtxt” file with a text-format ApiDefs message.

WARNING: Be very careful changing the API for any existing op – you can change the semantics of existing code. These changes may need to wait until a major release of TensorFlow to avoid breaking our compatibility promises.

Fields

graph_op_name: String

Name of the op (in the OpDef) to specify the API for.

deprecation_message: String

If this op is deprecated, set deprecation message to the message that should be logged when this op is used. The message should indicate alternative op to use, if any.

deprecation_version: i32

Major version when the op will be deleted. For e.g. set this value to 2 if op API should be removed in TensorFlow 2.0 and deprecated in versions before that.

visibility: i32endpoint: Vec<Endpoint>in_arg: Vec<Arg>out_arg: Vec<Arg>arg_order: Vec<String>

List of original in_arg names to specify new argument order. Length of arg_order should be either empty to keep current order or match size of in_arg.

attr: Vec<Attr>summary: String

One-line human-readable description of what the Op does.

description: String

Additional, longer human-readable description of what the Op does.

description_prefix: String

Modify an existing/inherited description by adding text to the beginning or end.

description_suffix: String

Implementations

Returns the enum value of visibility, or the default if the field is set to an invalid enum value.

Sets visibility to the provided enum value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Returns the encoded length of the message without a length delimiter.

Clears the message, resetting all fields to their default.

Encodes the message to a buffer. Read more

Encodes the message to a newly allocated buffer.

Encodes the message with a length-delimiter to a buffer. Read more

Encodes the message with a length-delimiter to a newly allocated buffer.

Decodes an instance of the message from a buffer. Read more

Decodes a length-delimited instance of the message from the buffer.

Decodes an instance of the message from a buffer, and merges it into self. Read more

Decodes a length-delimited instance of the message from buffer, and merges it into self. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.