# ExtractGlimpseV2

public final class **ExtractGlimpseV2** Extracts a glimpse from the input tensor.


Returns a set of windows called glimpses extracted at location
\`offsets\` from the input tensor. If the windows only partially
overlaps the inputs, the non overlapping areas will be filled with
random noise.


The result is a 4-D tensor of shape \`\[batch_size, glimpse_height,
glimpse_width, channels\]\`. The channels and batch dimensions are the
same as that of the input tensor. The height and width of the output
windows are specified in the \`size\` parameter.


The argument \`normalized\` and \`centered\` controls how the windows are built:

- If the coordinates are normalized but not centered, 0.0 and 1.0 correspond to the minimum and maximum of each height and width dimension.
- If the coordinates are both normalized and centered, they range from -1.0 to 1.0. The coordinates (-1.0, -1.0) correspond to the upper left corner, the lower right corner is located at (1.0, 1.0) and the center is at (0, 0).
- If the coordinates are not normalized they are interpreted as numbers of pixels.

<br />

<br />

<br />

<br />

### Nested Classes

|---|---|---|---|
| class | [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) || Optional attributes for `https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2` |

### Public Methods

|---|---|
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [asOutput](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#asOutput())() Returns the symbolic handle of a tensor. |
| static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) | [centered](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#centered(java.lang.Boolean))(Boolean centered) |
| static [ExtractGlimpseV2](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2) | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<java.lang.Float>,%20org.tensorflow.Operand<java.lang.Integer>,%20org.tensorflow.Operand<java.lang.Float>,%20org.tensorflow.op.core.ExtractGlimpseV2.Options...))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> input, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Integer\> size, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> offsets, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) options) Factory method to create a class wrapping a new ExtractGlimpseV2 operation. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [glimpse](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#glimpse())() A tensor representing the glimpses \`\[batch_size, glimpse_height, glimpse_width, channels\]\`. |
| static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) | [noise](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#noise(java.lang.String))(String noise) |
| static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) | [normalized](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#normalized(java.lang.Boolean))(Boolean normalized) |
| static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) | [uniformNoise](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2#uniformNoise(java.lang.Boolean))(Boolean uniformNoise) |

### 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() |

From interface [org.tensorflow.Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)

|---|---|
| abstract [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [asOutput](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand#asOutput())() Returns the symbolic handle of a tensor. |

## Public Methods

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

Returns the symbolic handle of a tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is
used to obtain a symbolic handle that represents the computation of the input.

<br />

#### public static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options)
**centered**
(Boolean centered)

<br />

##### Parameters

| centered | indicates if the offset coordinates are centered relative to the image, in which case the (0, 0) offset is relative to the center of the input images. If false, the (0,0) offset corresponds to the upper left corner of the input images. |
|---|---|

#### public static [ExtractGlimpseV2](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2)
**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)\<Float\> input, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Integer\> size, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> offsets, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options) options)

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

##### Parameters

| scope | current scope |
| input | A 4-D float tensor of shape \`\[batch_size, height, width, channels\]\`. |
| size | A 1-D tensor of 2 elements containing the size of the glimpses to extract. The glimpse height must be specified first, following by the glimpse width. |
| offsets | A 2-D integer tensor of shape \`\[batch_size, 2\]\` containing the y, x locations of the center of each window. |
| options | carries optional attributes values |
|---|---|

##### Returns

- a new instance of ExtractGlimpseV2

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

A tensor representing the glimpses \`\[batch_size,
glimpse_height, glimpse_width, channels\]\`.

#### public static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options)
**noise**
(String noise)

<br />

##### Parameters

| noise | indicates if the noise should \`uniform\`, \`gaussian\`, or \`zero\`. The default is \`uniform\` which means the noise type will be decided by \`uniform_noise\`. |
|---|---|

#### public static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options)
**normalized**
(Boolean normalized)

<br />

##### Parameters

| normalized | indicates if the offset coordinates are normalized. |
|---|---|

#### public static [ExtractGlimpseV2.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/ExtractGlimpseV2.Options)
**uniformNoise**
(Boolean uniformNoise)

<br />

##### Parameters

| uniformNoise | indicates if the noise should be generated using a uniform distribution or a Gaussian distribution. |
|---|---|