powered by
Converts values numerically (truncating or rounding) rather than reinterpreting the bits as ggml_cast does. Supports F32<->I32, F32<->I16, F32<->I8, F16<->F32 and BF16<->F32.
ggml_cast
ggml_cast_numeric(ctx, a, type)
Tensor of the requested type with a's shape
a
GGML context
Source tensor
Target type constant (e.g. GGML_TYPE_I32)
GGML_TYPE_I32
# \donttest{ ctx <- ggml_init(16 * 1024 * 1024) a <- ggml_new_tensor_1d(ctx, GGML_TYPE_F32, 10) i <- ggml_cast_numeric(ctx, a, GGML_TYPE_I32) ggml_free(ctx) # }
Run the code above in your browser using DataLab