docs: public <X extends SDVariable> X setupFunction(X function) {
          Preconditions.checkNotNull(function, "Passed in function must not be null!");
          if (function instanceof SDVariable) {
              if (function.getSameDiff() != this) {
                  function.setSameDiff(this);
              }
              return function;
          }
          return function;
      }