code: public SDVariable diag(String name, SDVariable x) {
          SDVariable ret = f().diag(x);
          return updateVariableNameAndReference(ret, name);
      }
docs: Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0<br>
  For example, if input = [1,2,3], then output is given by:<br>
  [ 1, 0, 0]<br>
  [ 0, 2, 0]<br>
  [ 0, 0, 3]<br>
  <br>
  Higher input ranks are also supported: if input has shape [a,...,R-1] then output[i,...,k,i,...,k] = input[i,...,k].
  i.e., for input rank R, output has rank 2R
  
  @param name Name of the output variable
  @param x    Input variable
  @return Output variable