Skip to content

current_date

CurrentDateLayer ¤

CurrentDateLayer(
    name=None, input_dtype=None, output_dtype=None, **kwargs
)

Bases: BaseLayer

Returns the current UTC date in yyyy-MM-dd format.

Initialises an instance of the CurrentDateLayer layer.

Parameters:

Name Type Description Default
name Optional[str]

Name of the layer. Defaults to None.

None
input_dtype Optional[str]

The dtype to cast the input to. Defaults to None.

None
output_dtype Optional[str]

The dtype to cast the output to. Defaults to None.

None
Source code in src/kamae/keras/tensorflow/layers/current_date.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
def __init__(
    self,
    name: Optional[str] = None,
    input_dtype: Optional[str] = None,
    output_dtype: Optional[str] = None,
    **kwargs: Any,
) -> None:
    """
    Initialises an instance of the CurrentDateLayer layer.

    :param name: Name of the layer. Defaults to `None`.
    :param input_dtype: The dtype to cast the input to. Defaults to `None`.
    :param output_dtype: The dtype to cast the output to. Defaults to `None`.
    """
    super().__init__(
        name=name, input_dtype=input_dtype, output_dtype=output_dtype, **kwargs
    )

compatible_dtypes property ¤

compatible_dtypes

Returns the compatible dtypes of the layer. Returns None as the layer only returns the current date as a string. It does not transform any input.

Returns:

Type Description
Optional[List[str]]

The compatible dtypes of the layer.

get_config ¤

get_config()

Gets the configuration of the CurrentDate layer. Used for saving and loading from a model.

Returns:

Type Description
Dict[str, Any]

Dictionary of the configuration of the layer.

Source code in src/kamae/keras/tensorflow/layers/current_date.py
82
83
84
85
86
87
88
89
90
def get_config(self) -> Dict[str, Any]:
    """
    Gets the configuration of the CurrentDate layer.
    Used for saving and loading from a model.

    :returns: Dictionary of the configuration of the layer.
    """
    config = super().get_config()
    return config