Profile for batched solve with 30 sources
================================================================================
         25230 function calls (25140 primitive calls) in 0.745 seconds

   Ordered by: cumulative time
   List reduced from 100 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.745    0.745 solver.py:1564(solve)
        1    0.001    0.001    0.745    0.745 solver.py:1789(_solve_batched)
        1    0.005    0.005    0.744    0.744 solver.py:1817(_solve_structure_batched)
     1230    0.489    0.000    0.489    0.000 {built-in method torch._C._linalg.linalg_solve}
      120    0.031    0.000    0.373    0.003 solver.py:1277(_process_layer)
      180    0.067    0.000    0.261    0.001 utils.py:351(redhstar)
       30    0.011    0.000    0.168    0.006 solver.py:2722(_connect_external_regions)
       60    0.000    0.000    0.145    0.002 solver.py:783(_solve_nonhomo_layer)
       60    0.077    0.001    0.145    0.002 algorithm.py:287(solve_nonhomo_layer)
       60    0.032    0.001    0.032    0.001 {built-in method torch._C._linalg.linalg_inv}
       30    0.006    0.000    0.017    0.001 solver.py:2942(_calculate_fields_and_efficiencies)
      900    0.005    0.000    0.007    0.000 utils.py:634(to_diag_util)
      271    0.000    0.000    0.003    0.000 utils.py:260(blockmat2x2)
        1    0.001    0.001    0.003    0.003 solver.py:1140(_setup_common_matrices_batched)
      845    0.003    0.000    0.003    0.000 {built-in method torch.cat}
     1326    0.001    0.000    0.003    0.000 _tensor.py:33(wrapped)
     1202    0.002    0.000    0.002    0.000 {built-in method torch.eye}
      786    0.001    0.000    0.001    0.000 {method 'clone' of 'torch._C.TensorBase' objects}
     3374    0.001    0.000    0.001    0.000 {method 'to' of 'torch._C.TensorBase' objects}
     1080    0.001    0.000    0.001    0.000 {method 'pow' of 'torch._C.TensorBase' objects}


