> 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::utils::get_data_per_model

> Extracts data from GXF Receivers.

#### Extracts data from GXF Receivers (with context and cuda stream handler)

```cpp showLineNumbers={false}
gxf_result_t holoscan::utils::get_data_per_model(
    InputContext &op_input,
    const std::vector<std::string> &in_tensors,
    HoloInfer::DataMap &data_per_input_tensor,
    std::map<std::string, std::vector<int>> &dims_per_tensor,
    bool cuda_buffer_out,
    const std::string &module,
    gxf_context_t &context,
    CudaStreamHandler &cuda_stream_handler
)
```

Extracts data from GXF Receivers.

This version of get\_data\_per\_model uses the legacy [CudaStreamHandler](../../../classes/cudastreamhandler) utility. Use the variant without a cuda\_stream\_handler argument to use the built-in [CudaObjectHandler](../../../classes/cudaobjecthandler) instead.

**Returns:** GXF result code

**Parameters**

Input context

Input tensor names

[Map](../../../classes/map) is updated with output tensor name as key mapped to data buffer

[Map](../../../classes/map) is updated with tensor name as key mapped to dimension of input tensor

Flag defining the location of output memory (Device or Host)

Module that called for data extraction

GXF execution context

Cuda stream handler

#### Extracts data from GXF Receivers (with cuda stream out)

```cpp showLineNumbers={false}
gxf_result_t holoscan::utils::get_data_per_model(
    InputContext &op_input,
    const std::vector<std::string> &in_tensors,
    HoloInfer::DataMap &data_per_input_tensor,
    std::map<std::string, std::vector<int>> &dims_per_tensor,
    bool cuda_buffer_out,
    const std::string &module,
    cudaStream_t &cuda_stream_out
)
```

Extracts data from GXF Receivers.

**Returns:** GXF result code

**Parameters**

Input context

Input tensor names

[Map](../../../classes/map) is updated with output tensor name as key mapped to data buffer

[Map](../../../classes/map) is updated with tensor name as key mapped to dimension of input tensor

Flag defining the location of output memory (Device or Host)

Module that called for data extraction

Any stream used from the input port will be stored here.