The resource theory of tensor networks