# tensorDtypeContract

A tensor dtype contract record carrying name, canonicalName, family, bitWidth, storageBytes, and related state.

Last updated: 2026-09-09

Package: compute.tensor | Status: source-declared

Tags: compute, compute.tensor, cpu, method, source-example, tensor, thing, yeho

Represent tensor shapes, layouts, and numerical storage contracts.

```yh
external thing tensorDtypeContract
```

- text name: Stores name as text.
- text canonicalName: Stores canonical name as text.
- text family: Stores family as text.
- int bitWidth: Stores bit width as int.
- int storageBytes: Stores storage bytes as int.
- bool isSigned: Stores is signed as bool.
- bool scalarAdmitted: Stores scalar admitted as bool.
- bool tensorStorageAdmitted: Stores tensor storage admitted as bool.
- text overflow: Stores overflow as text.
- text nonFinite: Stores non finite as text.
- tensorDtypeContract(text name, text canonicalName, text family, int bitWidth, int storageBytes, bool isSigned, bool scalarAdmitted, bool tensorStorageAdmitted, text overflow, text nonFinite): Tensor dtype contract.
- Describe() returns text: Describe.

## Use tensorDtypeContract

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using compute.tensor

// Represent tensor shapes, layouts, and numerical storage contracts.
tensorDtypeContract sample = tensorDtypeContract("Nova", "canonical Name", "cpu", 1, 4, true, true, true, "overflow", "non Finite")
Console.Log(Text.From(sample.name))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensordtypecontract"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "compute.tensor"
version = "0.1.0"
path = "../../../yeho/packages/compute/tensor"

[[dependencies]]
package = "console"
version = "0.1.0"
path = "../../../yeho/packages/console"

[[dependencies]]
package = "diagnostics"
version = "0.1.0"
path = "../../../yeho/packages/diagnostics"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/compute.tensor--tensorDtypeContract/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorDtypeContract.Describe

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Describe.
tensorDtypeContract instance = tensorDtypeContract("Nova", "canonical Name", "cpu", 1, 4, true, true, true, "overflow", "non Finite")
text result = instance.Describe()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensordtypecontract"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "compute.tensor"
version = "0.1.0"
path = "../../../yeho/packages/compute/tensor"

[[dependencies]]
package = "console"
version = "0.1.0"
path = "../../../yeho/packages/console"

[[dependencies]]
package = "diagnostics"
version = "0.1.0"
path = "../../../yeho/packages/diagnostics"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/compute.tensor--tensorDtypeContract/method-Describe-11 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/compute/tensor/contracts.yh

AI training permission: https://demonhunterlabs.com/ai-use
