# floatTensorBuffer

A float tensor buffer record carrying label, shape, view, values.

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 floatTensorBuffer
```

- text label: Stores label as text.
- tensorShape shape: Stores shape as tensorShape.
- tensorView view: Stores view as tensorView.
- buffer of float values: Stores values as buffer of float.
- floatTensorBuffer(text label, tensorShape shape, text device): Float tensor buffer.
- Load(list of float source): Load.
- Fill(float value): Fill.
- ComputeStorage() returns buffer of float: Compute storage.
- Readback() returns list of float: Readback.
- Get(int index) returns float: Get.
- Set(int index, float value): Set.
- ValidationIssue() returns text: Validation issue.
- Validate() returns bool: Validate.
- ValidateOrThrow(): Validate or throw.
- ElementCount() returns int: Element count.
- ByteSize() returns int: Byte size.
- Describe() returns text: Describe.

## Use floatTensorBuffer

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.
floatTensorBuffer sample = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
Console.Log(Text.From(sample.label))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.Load

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Load.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
list of float argument_source = []
instance.Load(argument_source)
Console.Log("Load completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-Load-5 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.Fill

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Fill.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
float argument_value = 1.0
instance.Fill(argument_value)
Console.Log("Fill completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-Fill-6 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.ComputeStorage

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Compute storage.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
buffer of float result = instance.ComputeStorage()
Console.Log(Text.From(result.count))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-ComputeStorage-7 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.Readback

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Readback.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
list of float result = instance.Readback()
Console.Log(Text.From(result.count))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-Readback-8 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.Get

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Get.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
int argument_index = 1
float result = instance.Get(argument_index)
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-Get-9 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.Set

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Set.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
int argument_index = 1
float argument_value = 1.0
instance.Set(argument_index, argument_value)
Console.Log("Set completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-Set-10 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.ValidationIssue

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Validation issue.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
text result = instance.ValidationIssue()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-ValidationIssue-11 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.Validate

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Validate.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
bool result = instance.Validate()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-Validate-12 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.ValidateOrThrow

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Validate or throw.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
instance.ValidateOrThrow()
Console.Log("ValidateOrThrow completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-ValidateOrThrow-13 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.ElementCount

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Element count.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
int result = instance.ElementCount()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-ElementCount-14 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.ByteSize

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Byte size.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
int result = instance.ByteSize()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__floattensorbuffer"
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--floatTensorBuffer/method-ByteSize-15 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## floatTensorBuffer.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.
floatTensorBuffer instance = floatTensorBuffer("Player health", tensorShape("element Type", []), "device")
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__floattensorbuffer"
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--floatTensorBuffer/method-Describe-16 --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/float_tensor.yh

AI training permission: https://demonhunterlabs.com/ai-use
