string_to_string_list
StringToStringListLayer ¤
StringToStringListLayer(
name=None,
input_dtype=None,
output_dtype=None,
separator=",",
default_value="",
list_length=1,
**kwargs
)
Bases: BaseLayer
A layer that converts a string to a list of strings by splitting on a separator. It takes a default value and a list_length parameter to ensure that the output tensor has the correct shape.
If the separator is empty, the string is split on bytes/characters.
Initialises the StringToStringListLayer layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
Optional[str]
|
The name of the layer. Defaults to |
None
|
input_dtype |
Optional[str]
|
The dtype to cast the input to. Defaults to |
None
|
output_dtype |
Optional[str]
|
The dtype to cast the output to. Defaults to |
None
|
separator |
str
|
The separator to use when joining the strings. Defaults to |
','
|
default_value |
str
|
The value to use when the input is empty. Defaults to |
''
|
list_length |
int
|
The length of the string list in the output tensor. Defaults to |
1
|
Source code in src/kamae/keras/tensorflow/layers/string_to_string_list.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
compatible_dtypes
property
¤
compatible_dtypes
get_config ¤
get_config()
Gets the configuration of the StringToStringList layer. Used for saving and loading from a model.
Specifically adds the axis, separator and keepdims to the config
dictionary.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dictionary of the configuration of the layer. |
Source code in src/kamae/keras/tensorflow/layers/string_to_string_list.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |