1syntax = "proto3"; 2 3package tensorflow.tpu; 4 5// In the comments here, "layout" refers to the top-level EmbeddingOutputLayout 6// proto contained in the TPUEmbeddingConfiguration. 7 8// This proto is deprecated and its contents are no longer used. 9 10// The embedding output consists of a list of tensors, each specified by an 11// EmbeddingOutputTensor proto within the EmbeddingOutputLayout (the "output" 12// field). Each table and feature lookup is then placed into some number of 13// particular positions within some output tensor (identified by "tensor_index" 14// within OutputLocation). The tree of table lookups, feature lookups, and 15// output locations is specified by the 16// "table(table_id).feature(feature_id).output_location" repeated fields within 17// EmbeddingOutputLayout. 18 19message TPUEmbeddingOutputLayout { 20 option deprecated = true; 21 22 // Location of one copy of the feature's data. 23 message OutputLocation { 24 // Which output tensor this copy of the feature will go into. Must be 25 // between 0 and layout.output_size(). 26 int32 tensor_index = 1; 27 28 // Offset in dimension 0 for this feature copy. Must be between 0 and 29 // layout.output(tensor_index).dim0_size_per_sample(). 30 int32 dim0_offset = 2; 31 32 // Offset in dimension 1 for this feature copy. Must be between 0 and 33 // layout.output(tensor_index).dim1_size() - table width; repeated or 34 // partially/fully overlapping values are allowed and results in the same 35 // range will be summed (with the gradients replicated in the backward 36 // pass). 37 int32 dim1_offset = 3; 38 } 39 40 // Description of the output placement for one feature. 41 message FeatureDescriptor { 42 // Typically, only one copy of each feature is used, but multiple are 43 // allowed and the same data will be copied to all of them (with the 44 // gradients summed in the backward pass). 45 repeated OutputLocation output_location = 1; 46 } 47 48 // Description of the output placement for features of one table. 49 message TableDescriptor { 50 // Output locations for each feature loaded from this table. 51 repeated FeatureDescriptor feature = 1; 52 } 53 // Output locations for each feature of each table. 54 repeated TableDescriptor table = 1; 55 56 // Data layout and shape computation information for a single output tensor. 57 // Any unused locations in the tensor will be filled with zeros, and 58 // corresponding gradients will be ignored. 59 60 // Size and layout information for 2-D tensors. 61 message TwoDOutputTensor { 62 // Multiplier for output dimension 0 size; used to match legacy format that 63 // stacks features within a sample in dimension 0. 64 int32 dim0_size_per_sample = 2; 65 66 // The size (in dimension 1) of this output tensor. 67 int32 dim1_size = 1; 68 } 69 70 // Format information for a single output tensor. 71 message EmbeddingOutputTensor { 72 oneof output_format { 73 TwoDOutputTensor two_d = 4; 74 } 75 } 76 77 // Shape and layout information for each tensor. 78 repeated EmbeddingOutputTensor output = 2; 79} 80