class_docstr: This class tests all member functions of crypten package
class_docstr_tok: ["This","class","tests","all","member","functions","of","crypten","package"]
docstr: Test that crypten.where properly conditions
code: def test_where(self) -> None:
      """Test that crypten.where properly conditions"""
      sizes = [(10,), (5, 10), (1, 5, 10)]
      y_types = [lambda x: x, crypten.cryptensor]
  
      for size, y_type in itertools.product(sizes, y_types):
          tensor1 = get_random_test_tensor(size=size, is_float=True)
          encrypted_tensor1 = crypten.cryptensor(tensor1)
          tensor2 = get_random_test_tensor(size=size, is_float=True)
          encrypted_tensor2 = y_type(tensor2)
  
          condition_tensor = (
              get_random_test_tensor(
                  max_value=1, size=size, is_float=False
              )
              + 1
          )
          condition_encrypted = crypten.cryptensor(condition_tensor)
          condition_bool = condition_tensor.bool()
  
          reference_out = torch.where(condition_bool, tensor1, tensor2)
  
          encrypted_out = crypten.where(
              condition_bool, encrypted_tensor1, encrypted_tensor2
          )
  
          y_is_private = crypten.is_encrypted_tensor(tensor2)
          self._check(
              encrypted_out,
              reference_out,
              f"{'private' if y_is_private else 'public'} y "
              "where failed with public condition",
          )
  
          encrypted_out = encrypted_tensor1.where(
              condition_encrypted, encrypted_tensor2
          )
          self._check(
              encrypted_out,
              reference_out,
              f"{'private' if y_is_private else 'public'} y "
              "where failed with private condition",
          )
  
imports: import itertools
  import logging
  import math
  import random
  import unittest
  from collections import defaultdict
  import crypten
  import crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common import serial
  from crypten.common.tensor_types import is_float_tensor
  from crypten.config import cfg
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from torch import nn
label_desc: Use image node_id 15 for calling the TestCrypten obj's underlying member method code with example usage: obj.test_where() without return types