




'''simple docstring'''







import os
import sys

import transformers


A     ='3'

print('Python version:', sys.version)
print('transformers version:', transformers.__version__)

try:
   import torch

   print('Torch version:', torch.__version__)
   print('Cuda available:', torch.cuda.is_available())
   print('Cuda version:', torch.version.cuda)
   print('CuDNN version:', torch.backends.cudnn.version())
   print('Number of GPUs available:', torch.cuda.device_count())
   print('NCCL version:', torch.cuda.nccl.version())
except ImportError:
   print('Torch version:', None)

try:
   import deepspeed

   print('DeepSpeed version:', deepspeed.__version__)
except ImportError:
   print('DeepSpeed version:', None)

try:
   import tensorflow as tf

   print('TensorFlow version:', tf.__version__)
   print('TF GPUs available:', bool(tf.config.list_physical_devices('GPU')))
   print('Number of TF GPUs available:', len(tf.config.list_physical_devices('GPU')))
except ImportError:
   print('TensorFlow version:', None)








'''simple docstring'''

class   __lowerCAmelCase						:  # Public class to implement a graph





      '''simple docstring'''






      def __init__(self    :    int   ,						UpperCamelCase    :    int   ,						UpperCamelCase    :    int   ,						UpperCamelCase    :    list[list[bool]] ):

             '''simple docstring'''







             lowercase__      			= row
             lowercase__      			= col
             lowercase__      			= graph



      def       UpperCamelCase__		(self    :    Optional[int]   ,						UpperCamelCase    :    int   ,						UpperCamelCase    :    int   ,						UpperCamelCase    :    list[list[bool]] ):

             '''simple docstring'''







             return (
                 0 <= i < self.ROW
                 and 0 <= j < self.COL
                 and not visited[i][j]
                 and self.graph[i][j]
             )



      def       UpperCamelCase__		(self    :    int   ,						UpperCamelCase    :    int   ,						UpperCamelCase    :    int   ,						UpperCamelCase    :    list[list[bool]] ):

             '''simple docstring'''







             lowercase__      			= [-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
             lowercase__      			= [-1, 0, 1, -1, 1, -1, 0, 1]
             lowercase__      			= True  # Make those cells visited
             for k in range(8 ):
                    if self.is_safe(i + row_nbr[k]   ,						j + col_nbr[k]   ,						UpperCamelCase ):
                           self.diffs(i + row_nbr[k]   ,						j + col_nbr[k]   ,						UpperCamelCase )






      def       UpperCamelCase__		(self    :    Dict ):  # And finally, count all islands.

             '''simple docstring'''







             lowercase__      			= [[False for j in range(self.COL )] for i in range(self.ROW )]
             lowercase__      			= 0
             for i in range(self.ROW ):
                    for j in range(self.COL ):
                           if visited[i][j] is False and self.graph[i][j] == 1:
                                  self.diffs(UpperCamelCase   ,						UpperCamelCase   ,						UpperCamelCase )
                                  count += 1
             return count




