vis4d.common.named_tuple¶
This module contains dictionary utility functions.
Functions
|
Get all keys in a NamedTuple. |
|
Get a value from a nested Named tuple. |
|
Check if obj is namedtuple. |
- get_from_namedtuple(entry, key)[source]¶
Get a value from a nested Named tuple.
Example passing key = “test.my.data” will resolve the value of the named tuple at ‘test’ ‘my’ ‘data’.
- Raises:
ValueError – If the key is not present in the named tuple.
- Return type:
Any
- is_namedtuple(obj)[source]¶
Check if obj is namedtuple.
https://github.com/pytorch/pytorch/blob/v1.8.1/torch/nn/parallel/scatter_gather.py#L4-L8
- Return type:
bool