MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / is_sequence

Function is_sequence

python/paddle/utils/layers_utils.py:106–112  ·  view source on GitHub ↗

Whether `seq` is an entry or nested structure

(seq: Any)

Source from the content-addressed store, hash-verified

104
105
106def is_sequence(seq: Any) -> TypeGuard[typing.Sequence[Any] | dict[str, Any]]:
107 """
108 Whether `seq` is an entry or nested structure
109 """
110 if isinstance(seq, dict):
111 return True
112 return isinstance(seq, Sequence) and not isinstance(seq, str)
113
114
115class UniqueIdMap(WeakKeyDictionary):

Callers 15

create_var_likeFunction · 0.90
_is_sequence_except_dictFunction · 0.90
infermeta_gradMethod · 0.90
to_static_variableFunction · 0.90
_yield_flat_nestFunction · 0.85
to_sequenceFunction · 0.85
flattenFunction · 0.85
pack_sequence_asFunction · 0.85
hold_mutable_varsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected