> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::detail::safe_tensor_element_bytes

> Compute product of shape dimensions * bytes_per_element with overflow detection.

```cpp showLineNumbers={false}
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.