def METHOD_NAME(self):
    obs_spec = TensorSpec((20, ), torch.float32)
    action_spec = TensorSpec((5, ), torch.float32)
    critic_net = CriticNetwork((obs_spec, action_spec),
                               joint_fc_layer_params=(256, 256))
    replicas = 4
    # ParallelCriticNetwork (PCN) is not always faster than NaiveParallelNetwork (NPN).
    # On my machine, for this particular example, with replicas=2,
    # PCN is faster when batch_size in (128, 256, ..., 2048)
    # NPN is faster when batch_size in (4096, 8192, 16384).
    # For a moderately large replicas (32), and smaller batch_size (128),
    # the speed difference is huge: PCN is 20 times faster than NPN.
    batch_size = 128
    def _train(pnet, name):
        t0 = time.time()
        optimizer = alf.optimizers.AdamTF(lr=1e-4)
        optimizer.add_param_group({'params': list(pnet.parameters())})
        for _ in range(100):
            obs = obs_spec.randn((batch_size, ))
            action = action_spec.randn((batch_size, ))
            values = pnet((obs, action))[0]
            target = torch.randn_like(values)
            cost = ((values - target)**2).sum()
            optimizer.zero_grad()
            cost.backward()
            optimizer.step()
        logging.info(
            "%s time=%s cost=%s" % (name, time.time() - t0, float(cost)))
    pnet = critic_net.make_parallel(replicas)
    _train(pnet, "ParallelCriticNetwork")
    pnet = NaiveParallelNetwork(critic_net, replicas)
    _train(pnet, "NaiveParallelNetwork")