rbnet.util.as_detached_tensor

rbnet.util.as_detached_tensor(t)[source]

Create a detached copy of tensor. If t already is a tensor, clone and detach it, otherwise create a new tensor.

Parameters:

t – tensor to detach and copy

Returns:

detached and copied tensor