@@ -10,11 +10,11 @@ use std::io::Write;
1010use std:: path:: Path ;
1111use std:: result:: Result ;
1212use tensorflow_op_codegen:: parser;
13- use tensorflow_op_codegen:: protos:: OpDef ;
13+ use tensorflow_op_codegen:: protos:: op_def :: OpDef ;
1414
1515use :: protobuf:: ProtobufEnum ;
16- use tensorflow_op_codegen:: protos:: AttrValue_oneof_value ;
17- use tensorflow_op_codegen:: protos:: OpDef_ArgDef ;
16+ use tensorflow_op_codegen:: protos:: attr_value :: AttrValue_oneof_value ;
17+ use tensorflow_op_codegen:: protos:: op_def :: OpDef_ArgDef ;
1818
1919#[ derive( Clone ) ]
2020struct Attr {
@@ -337,7 +337,7 @@ fn define_op<W: Write>(
337337 let mut attr_escaper = Escaper :: new ( keywords) ;
338338 for attr in op. attr . iter ( ) {
339339 // skip if the attr is for type annotation
340- if skip_attrs. contains ( & attr. get_name ( ) . to_string ( ) ) {
340+ if skip_attrs. contains ( attr. get_name ( ) ) {
341341 continue ;
342342 }
343343
@@ -637,14 +637,13 @@ fn main() -> Result<(), Box<dyn Error>> {
637637 . to_str ( )
638638 . ok_or ( "Unable to format path for tensorflow folder" ) ?,
639639 ) ?;
640- let ops = parser:: parse ( & ops_bytes) . map_err ( |e| {
640+ let ops = parser:: parse ( & ops_bytes) . inspect_err ( |e| {
641641 println ! ( "Parse error at {:?}" , e. pos) ;
642642 if let Some ( p) = & e. pos {
643643 let input = String :: from_utf8_lossy ( & ops_bytes) ;
644644 println ! ( "Previous: {}" , & input[ 0 ..* p] ) ;
645645 println ! ( "Next: {}" , & input[ * p..] ) ;
646646 }
647- e
648647 } ) ?;
649648 let keywords: HashSet < String > = [
650649 "abstract" ,
0 commit comments