"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "a9653400d3fac5b316429f641ae61846ae024cc7"
Unverified Commit e02bdce7 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

Revert "Handle PyTorch to Flax conversion of 1D convolutions (#15519)" (#15540)

This reverts commit 854a0d52.
parent 8ce13306
...@@ -88,12 +88,6 @@ def rename_key_and_reshape_tensor( ...@@ -88,12 +88,6 @@ def rename_key_and_reshape_tensor(
pt_tensor = pt_tensor.transpose(2, 3, 1, 0) pt_tensor = pt_tensor.transpose(2, 3, 1, 0)
return renamed_pt_tuple_key, pt_tensor return renamed_pt_tuple_key, pt_tensor
# conv1d layer
renamed_pt_tuple_key = pt_tuple_key[:-1] + ("kernel",)
if pt_tuple_key[-1] == "weight" and pt_tensor.ndim == 3 and not is_key_or_prefix_key_in_dict(pt_tuple_key):
pt_tensor = pt_tensor.transpose(2, 1, 0)
return renamed_pt_tuple_key, pt_tensor
# linear layer # linear layer
renamed_pt_tuple_key = pt_tuple_key[:-1] + ("kernel",) renamed_pt_tuple_key = pt_tuple_key[:-1] + ("kernel",)
if pt_tuple_key[-1] == "weight" and not is_key_or_prefix_key_in_dict(pt_tuple_key): if pt_tuple_key[-1] == "weight" and not is_key_or_prefix_key_in_dict(pt_tuple_key):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment