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: i32
endpoint: 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
sourceimpl ApiDef
impl ApiDef
sourcepub fn visibility(&self) -> Visibility
pub fn visibility(&self) -> Visibility
Returns the enum value of visibility
, or the default if the field is set to an invalid enum value.
sourcepub fn set_visibility(&mut self, value: Visibility)
pub fn set_visibility(&mut self, value: Visibility)
Sets visibility
to the provided enum value.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ApiDef
impl<'de> Deserialize<'de> for ApiDef
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Message for ApiDef
impl Message for ApiDef
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
sourcefn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
Encodes the message to a buffer. Read more
sourcefn encode_to_vec(&self) -> Vec<u8, Global>
fn encode_to_vec(&self) -> Vec<u8, Global>
Encodes the message to a newly allocated buffer.
sourcefn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError> where
B: BufMut,
Encodes the message with a length-delimiter to a buffer. Read more
sourcefn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>
Encodes the message with a length-delimiter to a newly allocated buffer.
sourcefn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes an instance of the message from a buffer. Read more
sourcefn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError> where
B: Buf,
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
sourcefn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
Decodes an instance of the message from a buffer, and merges it into self
. Read more
sourcefn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError> where
B: Buf,
Decodes a length-delimited instance of the message from buffer, and
merges it into self
. Read more
impl StructuralPartialEq for ApiDef
Auto Trait Implementations
impl RefUnwindSafe for ApiDef
impl Send for ApiDef
impl Sync for ApiDef
impl Unpin for ApiDef
impl UnwindSafe for ApiDef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more