Skip to content

Instantly share code, notes, and snippets.

@justinchuby
Created May 8, 2024 16:03
Show Gist options
  • Save justinchuby/247f189cedac7a48eb5eaa04b71c2cb0 to your computer and use it in GitHub Desktop.
Save justinchuby/247f189cedac7a48eb5eaa04b71c2cb0 to your computer and use it in GitHub Desktop.
ir_version: 8
producer_name: "pytorch"
producer_version: "2.3.0"
graph {
node {
output: "_val_2"
name: "Constant_0"
op_type: "Constant"
attribute {
name: "value_floats"
floats: 1.0
type: FLOATS
}
doc_string: ""
}
node {
input: "input_0"
output: "_val_3"
name: "Shape_1"
op_type: "Shape"
attribute {
name: "start"
i: -1
type: INT
}
doc_string: ""
}
node {
input: "_val_2"
input: "_val_3"
output: "_val_4"
name: "Expand_2"
op_type: "Expand"
doc_string: ""
}
node {
input: "_val_4"
input: "input_0"
output: "_val_5"
name: "CastLike_3"
op_type: "CastLike"
doc_string: ""
}
node {
input: "input_0"
input: "_val_5"
output: "_val_6"
output: "_val_7"
output: "_val_8"
name: "LayerNormalization_4"
op_type: "LayerNormalization"
attribute {
name: "axis"
i: -1
type: INT
}
attribute {
name: "epsilon"
f: 1e-05
type: FLOAT
}
attribute {
name: "stash_type"
i: 1
type: INT
}
doc_string: ""
}
name: "main_graph"
input {
name: "input_0"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 0
}
dim {
dim_value: 1
}
}
}
}
}
input {
name: "input_1"
type {
tensor_type {
elem_type: 7
shape {
dim {
dim_value: 1
}
}
}
}
}
output {
name: "_val_6"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 0
}
dim {
dim_value: 1
}
}
}
}
}
output {
name: "_val_7"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 0
}
dim {
dim_value: 1
}
}
}
}
}
output {
name: "_val_8"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 0
}
dim {
dim_value: 1
}
}
}
}
}
value_info {
name: "_val_2"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
}
}
}
}
value_info {
name: "_val_3"
type {
tensor_type {
elem_type: 7
shape {
dim {
dim_value: 1
}
}
}
}
}
value_info {
name: "_val_4"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
}
}
}
}
value_info {
name: "_val_5"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
}
}
}
}
}
opset_import {
domain: ""
version: 18
}
opset_import {
domain: "pkg.onnxscript.torch_lib.common"
version: 1
}
functions {
name: "Rank"
input: "input"
output: "return_val"
node {
input: "input"
output: "tmp"
name: "n0"
op_type: "Shape"
domain: ""
}
node {
input: "tmp"
output: "return_val"
name: "n1"
op_type: "Size"
domain: ""
}
doc_string: "Take the rank of the input tensor."
opset_import {
domain: ""
version: 18
}
domain: "pkg.onnxscript.torch_lib.common"
}
functions {
name: "IsScalar"
input: "input"
output: "return_val"
node {
input: "input"
output: "tmp"
name: "n0"
op_type: "Shape"
domain: ""
}
node {
input: "tmp"
output: "tmp_0"
name: "n1"
op_type: "Size"
domain: ""
}
node {
output: "tmp_1"
name: "n2"
op_type: "Constant"
attribute {
name: "value_int"
i: 0
type: INT
}
domain: ""
}
node {
input: "tmp_0"
input: "tmp_1"
output: "return_val"
name: "n3"
op_type: "Equal"
domain: ""
}
doc_string: "Return whether the input has rank 0, or is a scalar."
opset_import {
domain: ""
version: 18
}
domain: "pkg.onnxscript.torch_lib.common"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment