Vllm.Distributed.TensorMetadata (VLLM v0.3.0)

Copy Markdown View Source

TensorMetadata(device, dtype, size)

Summary

Functions

Return a new dict which maps field names to their values.

Make a new TensorMetadata object from a sequence or iterable

Return a new TensorMetadata object replacing specified fields with new values

Return number of occurrences of value.

Return first index of value.

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

Types

t()

@opaque t()

Functions

_asdict(ref, opts \\ [])

@spec _asdict(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}

Return a new dict which maps field names to their values.

Returns

  • term()

_make(ref, iterable, opts \\ [])

@spec _make(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Make a new TensorMetadata object from a sequence or iterable

Parameters

  • iterable (term())

Returns

  • term()

_replace(ref, opts \\ [])

@spec _replace(
  SnakeBridge.Ref.t(),
  keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}

Return a new TensorMetadata object replacing specified fields with new values

Parameters

  • kwds (term())

Returns

  • term()

count(ref, value, opts \\ [])

@spec count(SnakeBridge.Ref.t(), term(), keyword()) ::
  {:ok, term()} | {:error, Snakepit.Error.t()}

Return number of occurrences of value.

Parameters

  • value (term())

Returns

  • term()

device(ref)

@spec device(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}

dtype(ref)

@spec dtype(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}

index(ref, value, args, opts \\ [])

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

Return first index of value.

Raises ValueError if the value is not present.

Parameters

  • value (term())
  • start (term() default: 0)
  • stop (term() default: 9223372036854775807)

Returns

  • term()

new(args, opts \\ [])

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

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

Parameters

  • args (term())
  • kwargs (term())

size(ref)

@spec size(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}