@@ -6020,21 +6020,34 @@ public TFOutput Cross (TFOutput a, TFOutput b, string operName = null)
60206020 /// <param name="operName">
60216021 /// If specified, the created operation in the graph will be this one, otherwise it will be named 'CrossReplicaSum'.
60226022 /// </param>
6023+ /// <param name="group_assignment">
6024+ /// Optional argument
6025+ /// The list of group ids. <c>group_assignment[i]</c> represents the
6026+ /// group id of replica i.
6027+ /// </param>
60236028 /// <returns>
60246029 /// The sum of all the distributed inputs.
60256030 /// The TFOperation can be fetched from the resulting TFOutput, by fethching the Operation property from the result.
60266031 /// </returns>
60276032 /// <remarks>
6028- /// instance supplies its own input, and the output of each is the sum of
6029- /// all the inputs.
6033+ /// instance supplies its own input. If group_assignment is empty, the output of
6034+ /// each is the sum of all the inputs, otherwise the output of each is the sum of
6035+ /// the inputs belonging to the same group.
6036+ ///
6037+ /// For example, suppose there are 4 TPU instances: <c>[A, B, C, D]</c>. Passing
6038+ /// group_assignment=<c>[0,1,0,1]</c> sets <c>A, C</c> as group 0, and <c>B, D</c> as group 1.
6039+ /// Thus we get the outputs: <c>[A+C, B+D, A+C, B+D]</c>.
60306040 /// </remarks>
6031- public TFOutput CrossReplicaSum (TFOutput input, string operName = null)
6041+ public TFOutput CrossReplicaSum (TFOutput input, long[] group_assignment = null, string operName = null)
60326042 {
60336043 var desc = new TFOperationDesc (this, "CrossReplicaSum", MakeName ("CrossReplicaSum", operName));
60346044 desc.AddInput (input);
60356045 foreach ( TFOperation control in CurrentDependencies )
60366046 desc.AddControlInput (control);
60376047
6048+ if (group_assignment != null)
6049+ desc.SetAttr ("group_assignment", group_assignment);
6050+
60386051 var op = desc.FinishOperation ();
60396052 int _idx = 0;
60406053 var output = new TFOutput (op, _idx++);
@@ -11900,6 +11913,90 @@ public TFOutput GatherV2 (TFOutput parameters, TFOutput indices, TFOutput axis,
1190011913 return output;
1190111914 }
1190211915
11916+ /// <summary>
11917+ /// Re-configures the GCS block cache with the new configuration values.
11918+ /// </summary>
11919+ /// <param name="max_cache_size">
11920+ /// </param>
11921+ /// <param name="block_size">
11922+ /// </param>
11923+ /// <param name="max_staleness">
11924+ /// </param>
11925+ /// <param name="operName">
11926+ /// If specified, the created operation in the graph will be this one, otherwise it will be named 'GcsConfigureBlockCache'.
11927+ /// </param>
11928+ /// <returns>
11929+ /// Returns the description of the operation
11930+ /// </returns>
11931+ /// <remarks>
11932+ /// If the values are the same as already configured values, this op is a no-op. If
11933+ /// they are different, the current contents of the block cache is dropped, and a
11934+ /// new block cache is created fresh.
11935+ /// </remarks>
11936+ public TFOperation GcsConfigureBlockCache (TFOutput max_cache_size, TFOutput block_size, TFOutput max_staleness, string operName = null)
11937+ {
11938+ var desc = new TFOperationDesc (this, "GcsConfigureBlockCache", MakeName ("GcsConfigureBlockCache", operName));
11939+ desc.AddInput (max_cache_size);
11940+ desc.AddInput (block_size);
11941+ desc.AddInput (max_staleness);
11942+ foreach ( TFOperation control in CurrentDependencies )
11943+ desc.AddControlInput (control);
11944+
11945+ var op = desc.FinishOperation ();
11946+ return op;
11947+ }
11948+
11949+ /// <summary>
11950+ /// Configures the credentials used by the GCS client of the local TF runtime.
11951+ /// </summary>
11952+ /// <param name="json">
11953+ /// </param>
11954+ /// <param name="operName">
11955+ /// If specified, the created operation in the graph will be this one, otherwise it will be named 'GcsConfigureCredentials'.
11956+ /// </param>
11957+ /// <returns>
11958+ /// Returns the description of the operation
11959+ /// </returns>
11960+ /// <remarks>
11961+ /// The json input can be of the format:
11962+ ///
11963+ /// 1. Refresh Token:
11964+ /// {
11965+ /// "client_id": "&lt;redacted&gt;",
11966+ /// "client_secret": "&lt;redacted&gt;",
11967+ /// "refresh_token: "&lt;redacted&gt;",
11968+ /// "type": "authorized_user",
11969+ /// }
11970+ ///
11971+ /// 2. Service Account:
11972+ /// {
11973+ /// "type": "service_account",
11974+ /// "project_id": "&lt;redacted&gt;",
11975+ /// "private_key_id": "&lt;redacted&gt;",
11976+ /// "private_key": "------BEGIN PRIVATE KEY-----\n&lt;REDACTED&gt;\n-----END PRIVATE KEY------\n",
11977+ /// "client_email": "&lt;REDACTED&gt;@&lt;REDACTED&gt;.iam.gserviceaccount.com",
11978+ /// "client_id": "&lt;REDACTED&gt;",
11979+ /// # Some additional fields elided
11980+ /// }
11981+ ///
11982+ /// Note the credentials established through this method are shared across all
11983+ /// sessions run on this runtime.
11984+ ///
11985+ /// Note be sure to feed the inputs to this op to ensure the credentials are not
11986+ /// stored in a constant op within the graph that might accidentally be checkpointed
11987+ /// or in other ways be persisted or exfiltrated.
11988+ /// </remarks>
11989+ public TFOperation GcsConfigureCredentials (TFOutput json, string operName = null)
11990+ {
11991+ var desc = new TFOperationDesc (this, "GcsConfigureCredentials", MakeName ("GcsConfigureCredentials", operName));
11992+ desc.AddInput (json);
11993+ foreach ( TFOperation control in CurrentDependencies )
11994+ desc.AddControlInput (control);
11995+
11996+ var op = desc.FinishOperation ();
11997+ return op;
11998+ }
11999+
1190312000 /// <summary>
1190412001 /// Generates serialized partition messages suitable for batch reads.
1190512002 /// </summary>
0 commit comments