Bayesian CP Factorization of Incomplete Tensors with Automatic Rank Determination