parameters: (name)
return_statement: return cache[name]
docstring: Get layout extension object from its string representation.
docstring_summary: Get layout extension object from its string representation.
docstring_tokens: Get layout extension object from its string representation .
function: def _get_layout(name):
      """Get layout extension object from its string representation.
      """
      cache = _get_layout.cache   # type: ignore[attr-defined]
      if not cache:
          for v in torch.__dict__.values():
              if isinstance(v, torch.layout):
                  cache[str(v)] = v
      return cache[name]
function_tokens: def _get_layout ( name ) : cache = _get_layout . cache # type: ignore[attr-defined] if not cache : for v in torch . __dict__ . values ( ) : if isinstance ( v , torch . layout ) : cache [ str ( v ) ] = v return cache [ name ]