declearn.model.tensorflow.utils.preserve_tensor_device
Wrap a tensor-processing function to have it run on its inputs' device.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
func |
Callable[..., tf.Tensor]
|
Function to wrap, that takes a tensorflow Tensor as first argument. |
required |
Returns:
Name | Type | Description |
---|---|---|
func |
function(tf.Tensor, ...) -
|
Similar function to the input one, that operates under a |
Source code in declearn/model/tensorflow/utils/_gpu.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|