# Google Cloud Vision Ai V1 Client - Class MachineSpec (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 MachineSpec.

Specification of a single machine.

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

## Namespace

Google \\ Cloud \\ VisionAI \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ machine_type` | `string` Immutable. The type of the machine. See the [list of machine types supported for prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) See the [list of machine types supported for custom training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). For DeployedModel this field is optional, and the default value is `n1-standard-2`. For BatchPredictionJob or as part of WorkerPoolSpec this field is required. |
| `↳ accelerator_type` | `int` Immutable. The type of accelerator(s) that may be attached to the machine as per [accelerator_count](https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.MachineSpec#_Google_Cloud_VisionAI_V1_MachineSpec__getAcceleratorCount__). |
| `↳ accelerator_count` | `int` The number of accelerators to attach to the machine. |

### getMachineType

Immutable. The type of the machine.

See the [list of machine types supported for
prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
See the [list of machine types supported for custom
training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
For DeployedModel this field is optional, and the default
value is `n1-standard-2`. For BatchPredictionJob or as part of
WorkerPoolSpec this field is required.

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

### setMachineType

Immutable. The type of the machine.

See the [list of machine types supported for
prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types)
See the [list of machine types supported for custom
training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types).
For DeployedModel this field is optional, and the default
value is `n1-standard-2`. For BatchPredictionJob or as part of
WorkerPoolSpec this field is required.

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

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

### getAcceleratorType

Immutable. The type of accelerator(s) that may be attached to the machine
as per
[accelerator_count](https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.MachineSpec#_Google_Cloud_VisionAI_V1_MachineSpec__getAcceleratorCount__).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [AcceleratorType](https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.AcceleratorType). |

### setAcceleratorType

Immutable. The type of accelerator(s) that may be attached to the machine
as per
[accelerator_count](https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.MachineSpec#_Google_Cloud_VisionAI_V1_MachineSpec__getAcceleratorCount__).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [AcceleratorType](https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.AcceleratorType). |

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

### getAcceleratorCount

The number of accelerators to attach to the machine.

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

### setAcceleratorCount

The number of accelerators to attach to the machine.

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

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