Skip to contents

Convenience constructor that creates a DebugBox from a data type and shape, without having to manually construct an AbstractTensor first.

Usage

debug_box(dtype, shape, ambiguous = FALSE)

Arguments

dtype

(character(1) | stablehlo::TensorDataType)
Data type.

shape

(integer())
Shape.

ambiguous

(logical(1))
Whether the type is ambiguous. Ambiguous types usually arise from R literals (e.g., 1L, 1.0) and follow special promotion rules. See the vignette("type-promotion") for more details.

Value

(DebugBox)

Examples

# Create a debug box representing a 2x3 f32 tensor
db <- debug_box("f32", c(2L, 3L))
db
#> f32{2,3}
dtype(db)
#> <f32>
shape(db)
#> [1] 2 3