Skip to content

Commit 9ca566a

Browse files
Remove unused _add_batch_dimension function
This was presuambly used with TF1 but is not used anymore, so delete it. Reviewers: ondrasej Reviewed By: ondrasej Pull Request: #336
1 parent 8a0a35f commit 9ca566a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

gematria/granite/python/gnn_model_base.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,6 @@
3030
import tf_keras
3131

3232

33-
def _add_batch_dimension(shape: Sequence[int]) -> Sequence[Optional[int]]:
34-
"""Adds a batch dimension as the first dimension to a given shape.
35-
36-
Args:
37-
shape: The shape to which the dimension is added. The size in all dimensions
38-
must be at least one. Empty shape (i.e. the shape of scalar values) is
39-
allowed and it will produce a 1D tensor.
40-
41-
Returns:
42-
The shape with the batch dimension.
43-
44-
Raises:
45-
ValueError: When the input shape is not valid.
46-
"""
47-
if any(size <= 0 for size in shape):
48-
raise ValueError('The shape may contain only positive numbers')
49-
return (None, *shape)
50-
51-
5233
@dataclasses.dataclass(frozen=True)
5334
class GraphNetworkLayer:
5435
"""Specifies one segment of the pipeline of the graph network.

0 commit comments

Comments
 (0)