Check if a tensor's underlying data is ternary. This can be used to dispatch to optimized ternary matmul.