This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_duplicates_ignore_timestamp(filename): | |
seen = set() | |
temp_filename = filename + '.temp' | |
with open(filename, 'r') as f, open(temp_filename, 'w') as temp_file: | |
for line in f: | |
# Strip the timestamp | |
stripped_line = line[12:] | |
if stripped_line not in seen: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import sys | |
# Directory paths | |
plugins_dir = "./plugins/" | |
dialogue_dir = "yamls/dialogue/" | |
script_dir = "yamls/script/" | |
# Ensure the output directories exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@propertyWrapper | |
struct SmallNumber { | |
private var maximum: Int | |
private var number: Int | |
var wrappedValue: Int { | |
get { return number } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TaggedWeak<T: AnyObject, Hash: Hashable>: Hashable { | |
public static func == (lhs: TaggedWeak<T, Hash>, rhs: TaggedWeak<T, Hash>) -> Bool { | |
lhs.hash == rhs.hash | |
} | |
public func hash(into hasher: inout Hasher) { | |
hasher.combine(hash) | |
} | |
public weak var value: T? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct TaggedWeak<T: AnyObject, Hash: Hashable>: Hashable { | |
public static func == (lhs: TaggedWeak<T, Hash>, rhs: TaggedWeak<T, Hash>) -> Bool { | |
lhs.hash == rhs.hash | |
} | |
public func hash(into hasher: inout Hasher) { | |
hasher.combine(hash) | |
} | |
public weak var value: T? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import random | |
def genSequence(): | |
len = 101 | |
X = [] | |
for i in range(1, len): | |
X.append([[random.random()]]*i) | |
y = [] | |
for i in range(1, len): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import random | |
def genSequence(): | |
len = 101 | |
X = [] | |
for i in range(1, len): | |
X.append([[random.random()]]*i) | |
y = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
infix operator <<<: CompositionPrecedence | |
precedencegroup CompositionPrecedence { | |
associativity: left | |
} | |
public func <<<<A, B, C>( | |
_ g: @escaping (B) -> C, | |
_ f: @escaping (A) -> B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import Combine | |
var subscriptions = Set<AnyCancellable>() | |
func futureIncrement( | |
integer: Int, | |
afterDelay delay: TimeInterval) -> AnyPublisher<Int, Never> { | |
Deferred { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InvalidArgumentError: 9 root error(s) found. | |
(0) Invalid argument: {{function_node __inference_train_function_80125}} Compilation failure: Detected unsupported operations when trying to compile graph broadcast_weights_1_assert_broadcastable_is_valid_shape_has_valid_nonscalar_shape_true_79965_const_0[] on XLA_TPU_JIT: DenseToDenseSetOperation (No registered 'DenseToDenseSetOperation' OpKernel for XLA_TPU_JIT devices compatible with node {{node broadcast_weights_1/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation}}){{node broadcast_weights_1/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape/has_invalid_dims/DenseToDenseSetOperation}} | |
[[broadcast_weights_1/assert_broadcastable/is_valid_shape/has_valid_nonscalar_shape]] | |
[[broadcast_weights_1/assert_broadcastable/is_valid_shape]] | |
TPU compilation failed | |
[[tpu_compile_succeeded_assert/_16364550150888184836/_30]] | |
[[TPUReplicate/_compile/_2384856891229734177/_29/_1132]] | |
(1) Invalid argument |
NewerOlder