code: def from_spec(spec, kwargs=None):
          
          memory = util.get_object(
              obj=spec,
              predefined_objects=tensorforce.core.memories.memories,
              kwargs=kwargs
          )
          assert isinstance(memory, Memory)
          return memory
docs: Creates a memory from a specification dict.