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 | |
from google.protobuf.descriptor_pb2 import FileDescriptorSet | |
from google.protobuf.descriptor_pb2 import FileDescriptorProto | |
import baz_pb2 | |
def decode(x): | |
proto = FileDescriptorProto() |
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
# Copyright 2019 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
from tensorflow.keras import layers | |
import tensorflow as tf | |
import numpy as np | |
video_id = tf.feature_column.categorical_column_with_identity( | |
key="video_id", num_buckets=1000000, default_value=0 | |
) | |
features = { | |
"video_id": tf.sparse.from_dense([[2, 85, 0, 0, 0], [33, 78, 2, 73, 1]]), |
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
# save to /usr/local/bin/gpu-run | |
# exmaplea: gpu-run python train.py | |
# this makes Nvidia GPU idle at around 9W instead of 20W with the requirement of: | |
# 1. make sure no process using Nvidia GPU at idle, this requires setting up desktop manager to use iGPU | |
# 2. run this script | |
# 3. setup and run the systemd target at bottom of this file | |
# Function to restore low power state | |
function restore_power { | |
echo "Restoring low power state..." |
OlderNewer