# StatelessRandomGetKeyCounterAlg

public final class **StatelessRandomGetKeyCounterAlg** Picks the best algorithm based on device, and scrambles seed into key and counter.


This op picks the best counter-based RNG algorithm based on device, and scrambles a shape-\[2\] seed into a key and a counter, both needed by the counter-based algorithm. The scrambling is opaque but approximately satisfies the property that different seed results in different key/counter pair (which will in turn result in different random numbers).

<br />

### Public Methods

|---|---|
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Integer\> | [alg](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/StatelessRandomGetKeyCounterAlg#alg())() The RNG algorithm (shape int32\[\]). |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<?\> | [counter](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/StatelessRandomGetKeyCounterAlg#counter())() Counter for the counter-based RNG algorithm. |
| static \<T extends Number\> [StatelessRandomGetKeyCounterAlg](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/StatelessRandomGetKeyCounterAlg) | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/StatelessRandomGetKeyCounterAlg#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<T>))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> seed) Factory method to create a class wrapping a new StatelessRandomGetKeyCounterAlg operation. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<?\> | [key](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/StatelessRandomGetKeyCounterAlg#key())() Key for the counter-based RNG algorithm (shape uint64\[1\]). |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Integer\>
**alg**
()

The RNG algorithm (shape int32\[\]).

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<?\>
**counter**
()

Counter for the counter-based RNG algorithm. Since counter size is algorithm-dependent, this output will be right-padded with zeros to reach shape uint64\[2\] (the current maximal counter size among algorithms).

#### public static [StatelessRandomGetKeyCounterAlg](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/StatelessRandomGetKeyCounterAlg)
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<T\> seed)

Factory method to create a class wrapping a new StatelessRandomGetKeyCounterAlg operation.

##### Parameters

| scope | current scope |
| seed | 2 seeds (shape \[2\]). |
|---|---|

##### Returns

- a new instance of StatelessRandomGetKeyCounterAlg

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<?\>
**key**
()

Key for the counter-based RNG algorithm (shape uint64\[1\]).