fromkeys¶ class tensordict.fromkeys(keys: List[NestedKey], value: Any = 0)¶ 从键列表和单个值创建 tensordict。 参数: keys (list of NestedKey) – 一个可迭代对象,指定新字典的键。 value (兼容类型, 可选) – 所有键的值。默认为 0。