def calculate_gate_size(self):
        """
        Calculate the gate size from the gate_style.
        Returns:
          The per sample, per head parameter size of each gate.
        """
        if self.gate_style == 'unit':
            return self.mem_size
        elif self.gate_style == 'memory':
            return 1
        else:  # self.gate_style == None
            return 0

        Calculate the gate size from the gate_style.
        Returns:
          The per sample, per head parameter size of each gate.
        
models/relational_rnn_general.py