class_docstr: Copies the hidden tensor in a :class:`Portal`. It replaces the hidden
  tensor with copied one.
class_docstr_tok: ["Copies","the","hidden","tensor","in","a",":","class",":","`","Portal","`",".","It","replaces","the","hidden","tensor","with","copied","one","."]
code: def forward(
      ctx: Context,
      portal: Portal,
      prev_stream: AbstractStream,
      next_stream: AbstractStream,
      phony: Tensor,
  ) -> Tensor:
      ctx.portal = portal
  
      assert portal.tensor is not None
      (portal.tensor,) = Copy.forward(
          ctx, prev_stream, next_stream, portal.tensor
      )
  
      phony = get_phony(get_device(next_stream), requires_grad=False)
      return phony.detach()
  
imports: from typing import Any, List, Optional, Tuple
  import torch
  from torch import Tensor
  from .None import Namespace
  from ..copy import Context
  from ..copy import Copy
  from ..phony import get_phony
  from ..stream import AbstractStream, get_device
label_desc: Use image node_id 1 for calling the PortalCopy obj's underlying member method code with example usage: obj.forward(ctx, portal, prev_stream, next_stream, phony) and returns: phony