TensorDictBase.fromkeys#
- classmethod TensorDictBase.fromkeys(keys: List[NestedKey], value: Any = 0)#
Creates a tensordict from a list of keys and a single value.
Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.