MCPcopy
hub / github.com/ibab/tensorflow-wavenet / create_embedding_table

Function create_embedding_table

wavenet/model.py:15–21  ·  view source on GitHub ↗
(name, shape)

Source from the content-addressed store, hash-verified

13
14
15def create_embedding_table(name, shape):
16 if shape[0] == shape[1]:
17 # Make a one-hot encoding as the initial value.
18 initial_val = np.identity(n=shape[0], dtype=np.float32)
19 return tf.Variable(initial_val, name=name)
20 else:
21 return create_variable(name, shape)
22
23
24def create_bias_variable(name, shape):

Callers 1

_create_variablesMethod · 0.85

Calls 1

create_variableFunction · 0.85

Tested by

no test coverage detected