restored old tensor module as a separate file