Writes contents to the file at input filename. Creates file and recursively creates directory if not existing. Arguments: filename: scalar. The name of the file to which we write the contents. contents: scalar. The content to be written to the output file. Returns the created operation.
(scope *Scope, filename tf.Output, contents tf.Output)
| 37187 | // |
| 37188 | // Returns the created operation. |
| 37189 | func WriteFile(scope *Scope, filename tf.Output, contents tf.Output) (o *tf.Operation) { |
| 37190 | if scope.Err() != nil { |
| 37191 | return |
| 37192 | } |
| 37193 | opspec := tf.OpSpec{ |
| 37194 | Type: "WriteFile", |
| 37195 | Input: []tf.Input{ |
| 37196 | filename, contents, |
| 37197 | }, |
| 37198 | } |
| 37199 | return scope.AddOperation(opspec) |
| 37200 | } |
| 37201 | |
| 37202 | // MutableHashTableV2Attr is an optional argument to MutableHashTableV2. |
| 37203 | type MutableHashTableV2Attr func(optionalAttr) |