code: def deterministic_io(model):
      model = copy.deepcopy(model)
      for i, op in enumerate(model.InitProto().op):
          op.device_option.random_seed = i + 1
      if not model.Proto().external_output:
          model.Proto().external_output.extend(
              [model.Proto().op[-1].output[0]]
          )
      return model
  
imports: import unittest
  import numpy
  import copy
  from hypothesis import given
  import hypothesis.strategies
  from caffe2.python.model_helper import ModelHelper
  from caffe2.python.models import resnet
  from caffe2.python import workspace, brew
  import caffe2.python.hypothesis_test_util
  import caffe2.python.mkl.rewrite_graph
label_desc: Use image node_id 1 for calling a global function with example usage: deterministic_io(model) and returns: model