Skip to main content
Log in

Mojo struct

NamedTensor

struct NamedTensor

A named input tensor.

Fields

  • name (String): Name of the tensor.

Implemented traits

AnyType, Copyable, Movable, UnknownDestructibility

Methods

__init__

__init__[dtype: DType](out self, owned name: String, owned tensor: Tensor[dtype])

Creates a NamedTensor owning the tensor with a reference count.

Parameters:

  • dtype (DType): Data type of the tensor to own.

Args:

  • name (String): Name of the tensor.
  • tensor (Tensor[dtype]): Tensor to take ownership of.