# Google Cloud Vision Ai V1 Client - Class ResourceSpecification (0.3.0)

0.3.0 (latest) 0.2.0 0.1.0 Reference documentation and code samples for the Google Cloud Vision Ai V1 Client class ResourceSpecification.

ResourceSpec collects a set of resources that can
be used to specify requests and requirements.

Note: Highly experimental as this can be runtime dependent.
Can use the "extras" field to experiment first before trying
to abstract it.

Generated from protobuf message `google.cloud.visionai.v1.ResourceSpecification`

## Namespace

Google \\ Cloud \\ VisionAI \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ cpu` | `string` CPU specification. Examples: "100m", "0.5", "1", "2", ... correspond to 0.1, half, 1, or 2 cpus. Leave empty to let the system decide. Note that this does *not* determine the cpu vender/make, or its underlying clock speed and specific SIMD features. It is only the amount time it requires in timeslicing. |
| `↳ cpu_limits` | `string` CPU limit. Examples: "100m", "0.5", "1", "2", ... correspond to 0.1, half, 1, or 2 cpus. Leave empty to indicate no limit. |
| `↳ memory` | `string` Memory specification (in bytes). Examples: "128974848", "129e6", "129M", "123Mi", ... correspond to 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes. Leave empty to let the system decide. |
| `↳ memory_limits` | `string` Memory usage limits. Examples: "128974848", "129e6", "129M", "123Mi", ... correspond to 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes. Leave empty to indicate no limit. |
| `↳ gpus` | `int` Number of gpus. |
| `↳ latency_budget_ms` | `int` The maximum latency that this operator may use to process an element. If non positive, then a system default will be used. Operator developers should arrange for the system compute resources to be aligned with this latency budget; e.g. if you want a ML model to produce results within 500ms, then you should make sure you request enough cpu/gpu/memory to achieve that. |

### getCpu

CPU specification.

Examples:
"100m", "0.5", "1", "2", ... correspond to
0.1, half, 1, or 2 cpus.
Leave empty to let the system decide.
Note that this does *not* determine the cpu vender/make,
or its underlying clock speed and specific SIMD features.
It is only the amount time it requires in timeslicing.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setCpu

CPU specification.

Examples:
"100m", "0.5", "1", "2", ... correspond to
0.1, half, 1, or 2 cpus.
Leave empty to let the system decide.
Note that this does *not* determine the cpu vender/make,
or its underlying clock speed and specific SIMD features.
It is only the amount time it requires in timeslicing.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCpuLimits

CPU limit.

Examples:
"100m", "0.5", "1", "2", ... correspond to
0.1, half, 1, or 2 cpus.
Leave empty to indicate no limit.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setCpuLimits

CPU limit.

Examples:
"100m", "0.5", "1", "2", ... correspond to
0.1, half, 1, or 2 cpus.
Leave empty to indicate no limit.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMemory

Memory specification (in bytes).

Examples:
"128974848", "129e6", "129M", "123Mi", ... correspond to
128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
Leave empty to let the system decide.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setMemory

Memory specification (in bytes).

Examples:
"128974848", "129e6", "129M", "123Mi", ... correspond to
128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
Leave empty to let the system decide.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMemoryLimits

Memory usage limits.

Examples:
"128974848", "129e6", "129M", "123Mi", ... correspond to
128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
Leave empty to indicate no limit.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setMemoryLimits

Memory usage limits.

Examples:
"128974848", "129e6", "129M", "123Mi", ... correspond to
128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes.
Leave empty to indicate no limit.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGpus

Number of gpus.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setGpus

Number of gpus.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLatencyBudgetMs

The maximum latency that this operator may use to process an element.

If non positive, then a system default will be used.
Operator developers should arrange for the system compute resources to be
aligned with this latency budget; e.g. if you want a ML model to produce
results within 500ms, then you should make sure you request enough
cpu/gpu/memory to achieve that.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setLatencyBudgetMs

The maximum latency that this operator may use to process an element.

If non positive, then a system default will be used.
Operator developers should arrange for the system compute resources to be
aligned with this latency budget; e.g. if you want a ML model to produce
results within 500ms, then you should make sure you request enough
cpu/gpu/memory to achieve that.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |