torch.is_inference#
- torch.is_inference(input)#
Returns True if
inputis an inference tensor.A non-view tensor is an inference tensor if and only if it was allocated during inference mode. A view tensor is an inference tensor if and only if the tensor it is a view of is an inference tensor.
For details on inference mode please see Inference Mode.
- Parameters:
input (Tensor) – the input tensor.