pulsatrix
Loading...
Searching...
No Matches
pulsatrix::explainer_detail Namespace Reference

Shared helpers for the post-hoc explainers' host boundary. More...

Functions

DeviceBackend * backend_beside (const Tensor &like, DeviceBackend *backend)
 The backend to allocate a tensor through that must live beside like.
 

Detailed Description

Shared helpers for the post-hoc explainers' host boundary.

Note
The explainers run the network's forward/backward on whatever device it lives on, but their own bookkeeping (seeds, interpolation, perturbation, CAM weighting) is small host arithmetic: tensors are read to the host once (Tensor::to_host_vector / read_element) and every tensor handed back is uploaded with the values constructor.

Function Documentation

◆ backend_beside()

DeviceBackend * pulsatrix::explainer_detail::backend_beside ( const Tensor &  like,
DeviceBackend *  backend 
)
inline

The backend to allocate a tensor through that must live beside like.

Returns
backend when it serves like's device (the caller's choice, as before), else like's own owning backend – so a host-only backend argument never receives device data.