MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / is_tensor_like

Function is_tensor_like

PATH/core/fp16/utils.py:29–30  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

27# Akin to `torch.is_tensor`, but returns True for Variable
28# objects in pre-0.4.
29def is_tensor_like(x):
30 return torch.is_tensor(x) or isinstance(x, torch.autograd.Variable)
31
32# Wraps `torch.is_floating_point` if present, otherwise checks
33# the suffix of `x.type()`.

Callers 1

is_fp_tensorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected