code: def test_inplace_on_requires_grad():
      model = nn.Sequential(nn.Linear(1, 1), nn.ReLU(inplace=True))
      model = Pipe(
          model, [1, 1], devices=["cpu", "cpu"], checkpoint="always"
      )
  
      x = torch.rand(1)
      y = model(x)
  
      message = r"a leaf Variable that requires grad .* used in an in-place operation."
      with pytest.raises(RuntimeError, match=message):
          y.backward()
  
imports: import pytest
  import torch
  from torch import nn
  from fairscale.nn.pipe import Pipe
label_desc: Use image node_id 1 for calling a global function with example usage: test_inplace_on_requires_grad() without return types