added tdiff, to deal with derivatives of tensors by tensors.