Tensor research code