Learn Before
Concept
Querying Model Parameter Device Location
The specific hardware device where a neural network's parameters are stored can be programmatically verified. Because parameters are fundamentally tensors, their device location is accessed similarly: by inspecting the .device attribute in PyTorch and TensorFlow, the .ctx attribute in MXNet, or by mapping a device querying function over the parameter tree in JAX (e.g., jax.tree_util.tree_map(lambda x: x.device(), params)).
0
1
Updated 2026-05-09
Tags
D2L
Dive into Deep Learning @ D2L