FindTensors[i_, p_] := Sort @ split[][i, p]

Attributes[tens] = {Orderless}


split[t___][i_, p_] := Flatten[{gsplit[t][i, p], psplit[t][i, p]}]


gsplit[t___][i_, p_] := Apply[grest[t, 0, 0][p], distrib[i, 2], 1]

grest[t___][p_][{mu_, nu_}, i_] :=
  Prepend[#, MetricTensor[mu, nu]]&/@ split[t][i, p]


psplit[t___][i_, p_] :=
  prest[t][i, p]@@ (Table[#, {Length[i]}]& @ Range[Length[p]])

prest[t___][i_, p_][j__] :=
  Outer[tens[t, ##]@@ MapThread[#1[#2]&, {p[[{##}]], i}]&, j]


distrib[ind_, n_] := {ind[[#]], Delete[ind, List/@ #]}&/@
  Subsets[Range[Length[ind]], {n}]



test = FindTensors[{mu, nu, ro}, {p1, p2}]

