docstr: The basic setup for testing Swap_Align
docstr_tok: ["The","basic","setup","for","testing","Swap_Align"]
code: def _swap_align2nat(self, tensor, lambda_val):
      """
      The basic setup for testing Swap_Align
      """
      op = SwapAlign2Nat(lambda_val, pad_val=0.0)
      input = torch.from_numpy(tensor[None, :, :, :].astype("float32"))
      output = op.forward(input.cuda()).cpu().numpy()
      return output[0]
  
file_path: detectron2/projects/TensorMask/tests/test_swap_align2nat.py
imports: import unittest
  import torch
  from torch.autograd import gradcheck
  from tensormask.layers.swap_align2nat import SwapAlign2Nat
label_desc: Use image node_id 2 for calling the SwapAlign2NatTest obj's underlying member method code with example usage: obj._swap_align2nat(tensor, lambda_val) and returns: output