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