# tensorPlacement

A tensor placement record carrying device, memory, pinned, shared.

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 tensorPlacement
```

- text device: Stores device as text.
- text memory: Stores memory as text.
- bool pinned: Stores pinned as bool.
- bool shared: Stores shared as bool.
- tensorPlacement(text device, text memory): Tensor placement.
- ValidationIssue() returns text: Validation issue.
- Validate() returns bool: Validate.
- ValidateOrThrow(): Validate or throw.
- SetDevice(text device): Set device.
- SetMemory(text memory): Set memory.
- Pin(): Pin.
- Unpin(): Unpin.
- Share(): Share.
- Unshare(): Unshare.
- IsPinned() returns bool: Is pinned.
- IsShared() returns bool: Is shared.
- IsHost() returns bool: Is host.
- IsDevice() returns bool: Is device.
- Describe() returns text: Describe.

## Use tensorPlacement

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.
tensorPlacement sample = tensorPlacement("device", "memory")
Console.Log(Text.From(sample.device))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.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.
tensorPlacement instance = tensorPlacement("device", "memory")
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__tensorplacement"
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--tensorPlacement/method-ValidationIssue-5 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.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.
tensorPlacement instance = tensorPlacement("device", "memory")
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__tensorplacement"
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--tensorPlacement/method-Validate-6 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.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.
tensorPlacement instance = tensorPlacement("device", "memory")
instance.ValidateOrThrow()
Console.Log("ValidateOrThrow completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-ValidateOrThrow-7 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.SetDevice

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 device.
tensorPlacement instance = tensorPlacement("device", "memory")
text argument_device = "argument device"
instance.SetDevice(argument_device)
Console.Log("SetDevice completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-SetDevice-8 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.SetMemory

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 memory.
tensorPlacement instance = tensorPlacement("device", "memory")
text argument_memory = "argument memory"
instance.SetMemory(argument_memory)
Console.Log("SetMemory completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-SetMemory-9 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.Pin

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Pin.
tensorPlacement instance = tensorPlacement("device", "memory")
instance.Pin()
Console.Log("Pin completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-Pin-10 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.Unpin

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Unpin.
tensorPlacement instance = tensorPlacement("device", "memory")
instance.Unpin()
Console.Log("Unpin completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-Unpin-11 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.Share

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Share.
tensorPlacement instance = tensorPlacement("device", "memory")
instance.Share()
Console.Log("Share completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-Share-12 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.Unshare

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Unshare.
tensorPlacement instance = tensorPlacement("device", "memory")
instance.Unshare()
Console.Log("Unshare completed")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-Unshare-13 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.IsPinned

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Is pinned.
tensorPlacement instance = tensorPlacement("device", "memory")
bool result = instance.IsPinned()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-IsPinned-14 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.IsShared

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Is shared.
tensorPlacement instance = tensorPlacement("device", "memory")
bool result = instance.IsShared()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-IsShared-15 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.IsHost

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Is host.
tensorPlacement instance = tensorPlacement("device", "memory")
bool result = instance.IsHost()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-IsHost-16 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.IsDevice

A complete caller for this public method. Sample inputs are illustrative; native resources require their owning lifecycle.

Verification: type checked

```yh
using compute.tensor

// Is device.
tensorPlacement instance = tensorPlacement("device", "memory")
bool result = instance.IsDevice()
Console.Log(Text.From(result))

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_tensor__tensorplacement"
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--tensorPlacement/method-IsDevice-17 --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


## tensorPlacement.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.
tensorPlacement instance = tensorPlacement("device", "memory")
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__tensorplacement"
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--tensorPlacement/method-Describe-18 --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/tensor.yh

AI training permission: https://demonhunterlabs.com/ai-use
