Multidimensional Logical Operations

Is there a clean way to do the following?

Assume you have a tensor with shape=[D, M, N]. Suppose I have another tensor of size D. I want to do an element wise logical operation. For example:

tensor1[0, M, N] == tensor2[0]
tensor1[1, M, N] == tensor2[1]

This would ideally output a set of logical masks of shape=[D, M, N].

Thanks in advance for any suggestions!