code: public SDVariable trace(String name, SDVariable in) {
          validateNumerical("trace", in);
          SDVariable ret = f().trace(in);
          return updateVariableNameAndReference(ret, name);
      }
docs: Matrix trace operation
  For rank 2 matrices, the output is a scalar vith the trace - i.e., sum of the main diagonal.<br>
  For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])
  
  @param name Name of the output variable. May be null.
  @param in   Input variable
  @return Trace