code: def randn_ktensor(shape, rank, norm=None, random_state=None):
      
  
      # Check input.
      rns = _check_random_state(random_state)
  
      # Draw low-rank factor matrices with i.i.d. Gaussian elements.
      factors = KTensor([rns.standard_normal((i, rank)) for i in shape])
      return _rescale_tensor(factors, norm)
docs: Generates a random N-way tensor with rank R, where the entries are
      drawn from the standard normal distribution.
  
      Parameters
      ----------
      shape : tuple
          shape of the tensor
  
      rank : integer
          rank of the tensor
  
      norm : float or None, optional (defaults: None)
          If not None, the factor matrices are rescaled so that the Frobenius
          norm of the returned tensor is equal to ``norm``.
  
      random_state : integer, RandomState instance or None, optional (default ``None``)
          If integer, random_state is the seed used by the random number generator;
          If RandomState instance, random_state is the random number generator;
          If None, the random number generator is the RandomState instance used by np.random.
  
  
      Returns
      -------
      X : (I_1, ..., I_N) array_like
          N-way tensor with rank R.
  
      Example
      -------
      >>> # Create a rank-2 tensor of dimension 5x5x5:
      >>> import tensortools as tt
      >>> X = tt.randn_tensor((5,5,5), rank=2)