code: def lstsq(a, b):
      n = a.shape[1]
      if tf.rank(b) == 1:
          x = tf.squeeze(
              tf.linalg.lstsq(a, tf.expand_dims(b, -1), fast=False), -1
          )
      else:
          x = tf.linalg.lstsq(a, b, fast=False)
      residuals = tf.norm(tf.tensordot(a, x, 1) - b, axis=0) ** 2
      return x, residuals if tf.linalg.matrix_rank(
          a
      ) == n else tf.constant([])
  
file_path: tensorly/tensorly/backend/tensorflow_backend.py
imports: import numpy
  from .core import Backend, backend_types, backend_basic_math, backend_array
label_desc: Use image node_id 9 for calling the TensorflowBackend obj's underlying member method code with example usage: obj.lstsq(a, b) and returns: x,  unknown