holoscan::detail::safe_tensor_element_bytes

Beta
View as Markdown
uint64_t holoscan::detail::safe_tensor_element_bytes(
const uint64_t *shape,
uint32_t rank,
uint64_t bytes_per_element
)

Compute product of shape dimensions * bytes_per_element with overflow detection.

Returns 0 on overflow or if bytes_per_element is 0.