detrex.utils

detrex.utils.get_world_size() int[source]

Returns the number of processes.

detrex.utils.interpolate(input: Tensor, size: Optional[List[int]] = None, scale_factor: Optional[float] = None, mode: str = 'nearest', align_corners: Optional[bool] = None) Tensor[source]

Equivalent to torch.nn.functional.interpolate.

detrex.utils.inverse_sigmoid(x, eps=0.001)[source]

The inverse function for sigmoid activation function. Note: It might face numberical issues with fp16 small eps.

detrex.utils.is_dist_avail_and_initialized() bool[source]

Checking if the distributed package is available and the default process group has been initialized.