# `Vllm.Multimodal.Inputs.MultiModalFieldConfig`
[🔗](https://github.com/nshkrdotcom/vllm/blob/v0.3.0/lib/snakebridge_generated/vllm/multimodal/inputs/multi_modal_field_config.ex#L7)

MultiModalFieldConfig(field: vllm.multimodal.inputs.BaseMultiModalField, modality: str)

# `t`

```elixir
@opaque t()
```

# `batched`

```elixir
@spec batched(SnakeBridge.Ref.t(), String.t(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

Defines a field where an element in the batch is obtained by

indexing into the first dimension of the underlying data.

## Parameters

- `modality` - The modality of the multi-modal item that uses this keyword argument.
- `keep_on_cpu` - Whether to keep this field on the CPU for the model inputs.

## Returns

- `term()`

# `build_elems`

```elixir
@spec build_elems(
  SnakeBridge.Ref.t(),
  String.t(),
  (([(([term()] | [term()]) | term()) | {term(), term()}] | [term()]) | term())
  | {term(), term()},
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}
```

Python method `MultiModalFieldConfig.build_elems`.

## Parameters

- `key` (String.t())
- `batch` (((list(((list(term()) | list(term())) | term()) | {term(), term()}) | list(term())) | term())
| {term(), term()})

## Returns

- `term()`

# `flat`

```elixir
@spec flat(SnakeBridge.Ref.t(), String.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

Defines a field where an element in the batch is obtained by

slicing along the first dimension of the underlying data.

## Parameters

- `modality` - The modality of the multi-modal item that uses this keyword argument.
- `slices` - For each multi-modal item, a slice (dim=0) or a tuple of slices (dim>0) that is used to extract the data corresponding to it.
- `dim` - The dimension to extract data, default to 0.
- `keep_on_cpu` - Whether to keep this field on the CPU for the model inputs.

## Returns

- `term()`

# `flat_from_sizes`

```elixir
@spec flat_from_sizes(SnakeBridge.Ref.t(), String.t(), term(), [term()], keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

Defines a field where an element in the batch is obtained by

slicing along the first dimension of the underlying data.

## Parameters

- `modality` - The modality of the multi-modal item that uses this keyword argument.
- `size_per_item` - For each multi-modal item, the size of the slice that is used to extract the data corresponding to it.
- `dim` - The dimension to slice, default to 0.
- `keep_on_cpu` - Whether to keep this field on the CPU for the model inputs.

## Returns

- `term()`

# `new`

```elixir
@spec new(term(), String.t(), keyword()) ::
  {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
```

Initialize self.  See help(type(self)) for accurate signature.

## Parameters

- `field` (term())
- `modality` (String.t())

# `shared`

```elixir
@spec shared(SnakeBridge.Ref.t(), String.t(), integer(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}
```

Defines a field where an element in the batch is obtained by

taking the entirety of the underlying data.

This means that the data is the same for each element in the batch.

## Parameters

- `modality` - The modality of the multi-modal item that uses this keyword argument.
- `batch_size` - The number of multi-modal items which share this data.
- `keep_on_cpu` - Whether to keep this field on the CPU for the model inputs.

## Returns

- `term()`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
