class_docstr: Fake layer to test runtime and memory benchmarking.
  
  Kwargs:
      runtime: duration for one forward or backward pass
      pass_memory: memory used during a forward or backward pass
      layer_memory: memory taken up by the module
class_docstr_tok: ["Fake","layer","to","test","runtime","and","memory","benchmarking",".","Kwargs",":","runtime",":","duration","for","one","forward","or","backward","pass","pass_memory",":","memory","used","during","a","forward","or","backward","pass","layer_memory",":","memory","taken","up","by","the","module"]
docstr: Wait for self.duration and allocate self.max_memory bytes
docstr_tok: ["Wait","for","self.duration","and","allocate","self.max_memory","bytes"]
code: def forward_only(self) -> torch.Tensor:
      """Wait for self.duration and allocate self.max_memory bytes"""
      time.sleep(self._runtime)
      tensor = get_n_byte_tensor(
          self._pass_memory,
          device=torch.device(
              "cuda:0" if torch.cuda.is_available() else "cpu"
          ),
      )
      return tensor
  
file_path: opacus/benchmarks/tests/test_benchmark_layer.py
imports: import math
  import time
  import pytest
  import torch
  import torch.nn
  from helpers import get_actual_memory_allocated, get_n_byte_tensor, skipifnocuda
  from benchmarks.benchmark_layer import run_layer_benchmark
  from benchmarks.layers import Layer
  from benchmarks.utils import reset_peak_memory_stats
label_desc: Use image node_id 2 for calling the FakeLayer obj's underlying member method code with example usage: obj.forward_only() and returns: tensor