def _get_keras_tensor(self):
        """
        Helper function to get the feature layer output tensor in the keras graph
        :return: Output tensor
        """
        if self.estimator._layer_names is None:
            raise ValueError("No layer names identified.")

        if isinstance(self.feature_layer, six.string_types):
            if self.feature_layer not in self.estimator._layer_names:
                raise ValueError(f"Layer name {self.feature_layer} is not part of the graph.")
            layer_name = self.feature_layer
        elif isinstance(self.feature_layer, int):
            if self.feature_layer < 0 or self.feature_layer >= len(self.estimator._layer_names):
                raise ValueError(
                    f"Layer index {self.feature_layer} is outside of range [0 to "
                    f"{len(self.estimator._layer_names) - 1}])."
                )
            layer_name = self.estimator._layer_names[self.feature_layer]
        else:
            raise TypeError("Layer must be of type `str` or `int`.")

        keras_layer = self.estimator._model.get_layer(layer_name)
        num_inbound_nodes = len(getattr(keras_layer, "_inbound_nodes", []))
        if num_inbound_nodes > 1:
            layer_output = keras_layer.get_output_at(0)
        else:
            layer_output = keras_layer.output
        return layer_output

        Helper function to get the feature layer output tensor in the keras graph
        :return: Output tensor
        
art/attacks/poisoning/hidden_trigger_backdoor/hidden_trigger_backdoor_keras.py