MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _get_sequence

Function _get_sequence

tensorflow/python/ops/nn_ops.py:62–83  ·  view source on GitHub ↗

Formats a value input for gen_nn_ops.

(value, n, channel_index, name)

Source from the content-addressed store, hash-verified

60
61
62def _get_sequence(value, n, channel_index, name):
63 """Formats a value input for gen_nn_ops."""
64 if value is None:
65 value = [1]
66 elif not isinstance(value, collections_abc.Sized):
67 value = [value]
68
69 current_n = len(value)
70 if current_n == n + 2:
71 return value
72 elif current_n == 1:
73 value = list((value[0],) * n)
74 elif current_n == n:
75 value = list(value)
76 else:
77 raise ValueError("{} should be of length 1, {} or {} but was {}".format(
78 name, n, n + 2, current_n))
79
80 if channel_index == 1:
81 return [1, 1] + value
82 else:
83 return [1] + value + [1]
84
85
86def _non_atrous_convolution(

Callers 15

__init__Method · 0.70
convolution_internalFunction · 0.70
conv1dFunction · 0.70
conv1d_transposeFunction · 0.70
conv2dFunction · 0.70
conv2d_transpose_v2Function · 0.70
conv3d_transpose_v2Function · 0.70
avg_pool_v2Function · 0.70
avg_poolFunction · 0.70
avg_pool2dFunction · 0.70
avg_pool1dFunction · 0.70
avg_pool3dFunction · 0.70

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected