Operator
Stay organized with collections
Save and categorize content based on your preferences.
Annotation used by classes to make TensorFlow operations conveniently accessible via org.tensorflow.op.Ops
.
An annotation processor (org.tensorflow.processor.OperatorProcessor
) builds the
Ops
class by aggregating all classes annotated as @Operator
s. Each annotated
class must have at least one public static factory method named create
that
accepts a Scope
as its first argument. The processor then adds a
convenience method in the Ops
class. For example:
{@code
Public Methods
String
|
group()
Specify an optional group within the Ops class.
|
String
|
name()
Name for the wrapper method used in the Ops class.
|
Inherited Methods
From interface
java.lang.annotation.Annotation
abstract
Class<? extends Annotation>
|
annotationType()
|
abstract
boolean
|
equals(Object arg0)
|
abstract
int
|
hashCode()
|
abstract
String
|
toString()
|
Public Methods
public
String
group
()
Specify an optional group within the Ops
class.
By default, an annotation processor will create convenience methods directly in the Ops
class. An annotated operator may optionally choose to place the method within a group. For
example:
{@code
public
String
name
()
Name for the wrapper method used in the Ops
class.
By default, a processor derives the method name in the Ops
class from the class name
of the operator. This attribute allow you to provide a different name instead. For example:
{@code
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# Operator\n\npublic abstract @interface **Operator** \nAnnotation used by classes to make TensorFlow operations conveniently accessible via `org.tensorflow.op.Ops`.\n\nAn annotation processor (`org.tensorflow.processor.OperatorProcessor`) builds the\n`Ops` class by aggregating all classes annotated as `@Operator`s. Each annotated\nclass **must** have at least one public static factory method named `create` that\naccepts a [Scope](/versions/r2.14/api_docs/java/org/tensorflow/op/Scope) as its first argument. The processor then adds a\nconvenience method in the `Ops` class. For example:\n\n```\n{@code\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| String | [group](/versions/r2.14/api_docs/java/org/tensorflow/op/annotation/Operator#group())() Specify an optional group within the `Ops` class. |\n| String | [name](/versions/r2.14/api_docs/java/org/tensorflow/op/annotation/Operator#name())() Name for the wrapper method used in the `Ops` class. |\n\n### Inherited Methods\n\nFrom interface java.lang.annotation.Annotation \n\n|----------------------------------------|---------------------|\n| abstract Class\\\u003c? extends Annotation\\\u003e | annotationType() |\n| abstract boolean | equals(Object arg0) |\n| abstract int | hashCode() |\n| abstract String | toString() |\n\nPublic Methods\n--------------\n\n#### public String\n**group**\n()\n\nSpecify an optional group within the `Ops` class.\n\nBy default, an annotation processor will create convenience methods directly in the `Ops` class. An annotated operator may optionally choose to place the method within a group. For\nexample:\n\n```\n{@code\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n#### public String\n**name**\n()\n\nName for the wrapper method used in the `Ops` class.\n\nBy default, a processor derives the method name in the `Ops` class from the class name\nof the operator. This attribute allow you to provide a different name instead. For example:\n\n```\n{@code\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]