import tensorflow as tf

    tt_cores = list(tt_cores)
    if convert_to_tensors:
      with tf.name_scope(name):
        for i in range(len(tt_cores)):
          name = "core%d" % i
          tt_cores[i] = tf.convert_to_tensor(tt_cores[i], name=name)

    if not _are_tt_cores_valid(tt_cores, shape, tt_ranks):
      raise ValueError('The tt_cores provided to TensorTrain constructor are '
                       'not valid, have different dtypes, or are inconsistent '
