MCPcopy
hub / github.com/shenweichen/DeepCTR-Torch / combined_dnn_input

Function combined_dnn_input

deepctr_torch/inputs.py:126–138  ·  view source on GitHub ↗
(sparse_embedding_list, dense_value_list)

Source from the content-addressed store, hash-verified

124
125
126def combined_dnn_input(sparse_embedding_list, dense_value_list):
127 if len(sparse_embedding_list) > 0 and len(dense_value_list) > 0:
128 sparse_dnn_input = torch.flatten(
129 torch.cat(sparse_embedding_list, dim=-1), start_dim=1)
130 dense_dnn_input = torch.flatten(
131 torch.cat(dense_value_list, dim=-1), start_dim=1)
132 return concat_fun([sparse_dnn_input, dense_dnn_input])
133 elif len(sparse_embedding_list) > 0:
134 return torch.flatten(torch.cat(sparse_embedding_list, dim=-1), start_dim=1)
135 elif len(dense_value_list) > 0:
136 return torch.flatten(torch.cat(dense_value_list, dim=-1), start_dim=1)
137 else:
138 raise NotImplementedError
139
140
141def get_varlen_pooling_list(embedding_dict, features, feature_index, varlen_sparse_feature_columns, device):

Callers 15

forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85

Calls 1

concat_funFunction · 0.85

Tested by

no test coverage detected