Learn R Programming

ggmlR (version 0.6.1)

ag_tensor: Create a dynamic tensor (no gradient tracking)

Description

ag_tensor is backed by an R environment so all references to the same tensor see updates (like PyTorch tensors).

Usage

ag_tensor(
  data,
  device = .ag_device_state$device,
  dtype = .ag_device_state$dtype
)

Value

An ag_tensor object (environment)

Arguments

data

Numeric matrix or vector

device

"cpu" (default) or "gpu". When "gpu", compute operations will be dispatched to the ggml backend.

dtype

Floating-point precision: "f32" (default), "f16", or "bf16". Ignored on CPU; controls upload precision on GPU.